# 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);
our @HELP = (
's:' => 'match within Subject e.g. s:"a quick brown fox"',
'd:' => <<EOF,
-match date range, git "approxidate" formats supported
-Open-ended ranges such as `d:last.week..' and `d:..2.days.ago'
-are supported
+match date-time range, git "approxidate" formats supported
+Open-ended ranges such as `d:last.week..' and
+`d:..2.days.ago' are supported
EOF
'b:' => 'match within message body, including text attachments',
'nq:' => 'match non-quoted text within message body',
'dfpost:' => 'match post-image git blob ID',
'dfblob:' => 'match either pre or post-image git blob ID',
'rt:' => <<EOF,
-match received time, like `d:' unless sender's clock was broken
+match received time, like `d:' if sender's clock was correct
EOF
);
chomp @HELP;
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 -