about summary refs log tree commit homepage
path: root/lib/PublicInbox/MboxReader.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-02 09:35:30 +0000
committerEric Wong <e@80x24.org>2023-11-03 06:39:28 +0000
commitd3c55d072839286efb2865fe20f2324a9e595e95 (patch)
treec3a7b450e22a0e9d7e849d53884f6af8af19cee5 /lib/PublicInbox/MboxReader.pm
parent19f9089343c9e579253db756f2131ee493718ead (diff)
downloadpublic-inbox-d3c55d072839286efb2865fe20f2324a9e595e95.tar.gz
treewide: use ->close to call ProcessIO->CLOSE
This will open the door for us to drop `tie' usage from
ProcessIO completely in favor of OO method dispatch.  While
OO method dispatches (e.g. `$fh->close') are slower than normal
subroutine calls, it hardly matters in this case since process
teardown is a fairly rare operation and we continue to use
`close($fh)' for Maildir writes.
Diffstat (limited to 'lib/PublicInbox/MboxReader.pm')
-rw-r--r--lib/PublicInbox/MboxReader.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/MboxReader.pm b/lib/PublicInbox/MboxReader.pm
index d67fb4eb..3d78ca23 100644
--- a/lib/PublicInbox/MboxReader.pm
+++ b/lib/PublicInbox/MboxReader.pm
@@ -29,7 +29,7 @@ sub _mbox_from {
         my @raw;
         while (defined(my $r = read($mbfh, $buf, 65536, length($buf)))) {
                 if ($r == 0) { # close here to check for "curl --fail"
-                        close($mbfh) or die "error closing mbox: \$?=$? $!";
+                        $mbfh->close or die "error closing mbox: \$?=$? $!";
                         @raw = ($buf);
                 } else {
                         @raw = split(/$from_strict/mos, $buf, -1);
@@ -88,7 +88,7 @@ sub _mbox_cl ($$$;@) {
         my $buf = '';
         while (defined(my $r = read($mbfh, $buf, 65536, length($buf)))) {
                 if ($r == 0) { # detect "curl --fail"
-                        close($mbfh) or
+                        $mbfh->close or
                                 die "error closing mboxcl/mboxcl2: \$?=$? $!";
                         undef $mbfh;
                 }