]> Sergey Matveev's repositories - public-inbox.git/blobdiff - scripts/import_slrnspool
favor `do {}' over `eval {}' for localized slurp
[public-inbox.git] / scripts / import_slrnspool
index 1dccb8dd51c10793f06eca441eaf02156e15f427..480e7b4fa5ade57aa42d36de01e9861a964e75cd 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2015-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Incremental (or one-shot) importer of a slrnpull news spool
@@ -26,7 +26,7 @@ my $config = PublicInbox::Config->new;
 my $ibx = $config->lookup($recipient);
 my $git = $ibx->git;
 my $im;
-if (($ibx->{version} || 1) == 2) {
+if ($ibx->version == 2) {
        require PublicInbox::V2Writable;
        $im = PublicInbox::V2Writable->new($ibx);
        $im->{parallel} = 0; # pointless to be parallel for a single message
@@ -70,7 +70,7 @@ for (; $exit == 0 && $n < $max; $n++) {
        $max = $n + $max_gap;
        print STDERR $fn, "\n";
 
-       my $mime = PublicInbox::MIME->new(eval { local $/; <$fh> });
+       my $mime = PublicInbox::MIME->new(do { local $/; <$fh> });
        $filter->scrub($mime);
        $im->add($mime);