]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Search.pm
inbox + search: use 5.10.1 and do some golfing
[public-inbox.git] / lib / PublicInbox / Search.pm
index 145fb56ce75006d167efc541257aa05f37b5cd5f..600e6400d4b672bb477a236eff12c27b9c3e4f51 100644 (file)
@@ -5,6 +5,7 @@
 # Read-only search interface for use by the web and NNTP interfaces
 package PublicInbox::Search;
 use strict;
+use v5.10.1;
 use parent qw(Exporter);
 our @EXPORT_OK = qw(retry_reopen int_val get_pct xap_terms);
 use List::Util qw(max);
@@ -398,12 +399,10 @@ sub retry_reopen {
        my ($self, $cb, @arg) = @_;
        for my $i (1..10) {
                if (wantarray) {
-                       my @ret;
-                       eval { @ret = $cb->($self, @arg) };
+                       my @ret = eval { $cb->($self, @arg) };
                        return @ret unless $@;
                } else {
-                       my $ret;
-                       eval { $ret = $cb->($self, @arg) };
+                       my $ret = eval { $cb->($self, @arg) };
                        return $ret unless $@;
                }
                # Exception: The revision being read has been discarded -