use PublicInbox::GitHTTPBackend;
use PublicInbox::Git;
# not bothering with Exporter for a one-off
-*input_prepare = *PublicInbox::GitHTTPBackend::input_prepare;
-*serve = *PublicInbox::GitHTTPBackend::serve;
-use warnings;
+*input_prepare = \&PublicInbox::GitHTTPBackend::input_prepare;
+*serve = \&PublicInbox::GitHTTPBackend::serve;
use PublicInbox::Qspawn;
use PublicInbox::WwwStatic qw(r);
my ($self) = @_;
$cleanup_avail = cleanup_possible() if $cleanup_avail < 0;
return if $cleanup_avail != 1;
- $cleanup_timer ||= PublicInbox::DS::later(*cleanup_task);
+ $cleanup_timer //= PublicInbox::DS::later(\&cleanup_task);
$CLEANUP->{"$self"} = $self;
}
# The default is 2.
our $run_script_exit_code;
sub RUN_SCRIPT_EXIT () { "RUN_SCRIPT_EXIT\n" };
-sub run_script_exit (;$) {
+sub run_script_exit {
$run_script_exit_code = $_[0] // 0;
die RUN_SCRIPT_EXIT;
}
use strict;
use subs qw(exit);
-*exit = *PublicInbox::TestCommon::run_script_exit;
+*exit = \\&PublicInbox::TestCommon::run_script_exit;
sub main {
# the below "line" directive is a magic comment, see perlsyn(1) manpage
# line 1 "$f"
# TODO: +cgit
my %VALID = (
- all => *list_all,
- 'match=domain' => *list_match_domain,
- 404 => *list_404,
+ all => \&list_all,
+ 'match=domain' => \&list_match_domain,
+ 404 => \&list_404,
);
sub set_cb ($$$) {
}
}
-my $opt = { pre => *pad_msgs };
+my $opt = { pre => \&pad_msgs };
test_replace(2, 'basic', {});
test_replace(2, 'basic', $opt);
-test_replace(2, 'basic', $opt = { %$opt, post => *pad_msgs });
+test_replace(2, 'basic', $opt = { %$opt, post => \&pad_msgs });
test_replace(2, 'basic', $opt = { %$opt, rotate_bytes => 1 });
SKIP: {
PublicInbox::Search::load_xapian() or skip 'Search::Xapian missing', 8;
for my $l (qw(medium)) {
test_replace(2, $l, {});
- $opt = { pre => *pad_msgs };
+ $opt = { pre => \&pad_msgs };
test_replace(2, $l, $opt);
- test_replace(2, $l, $opt = { %$opt, post => *pad_msgs });
+ test_replace(2, $l, $opt = { %$opt, post => \&pad_msgs });
test_replace(2, $l, $opt = { %$opt, rotate_bytes => 1 });
}
};
my $res;
my $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] });
open my $log, '+>>', "$inboxdir/solve.log" or die "open: $!";
-my $psgi_env = { 'psgi.errors' => *STDERR, 'psgi.url_scheme' => 'http',
+my $psgi_env = { 'psgi.errors' => \*STDERR, 'psgi.url_scheme' => 'http',
'HTTP_HOST' => 'example.com' };
$solver->solve($psgi_env, $log, '69df7d5', {});
ok($res, 'solved a blob!');
while (<$fh>) {
my ($oid, $type) = split / /;
next if $type ne 'blob';
- $git->cat_async($oid, *compare);
+ $git->cat_async($oid, \&compare);
}
$git->cat_async_wait;
ok(1);