diff options
author | Eric Wong <e@80x24.org> | 2020-09-09 06:26:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-09-10 19:45:18 +0000 |
commit | 934fea5e3b3c4c1ef0cef29477941ebfc44ff7e0 (patch) | |
tree | 6217ad86260050f1e2a271536d1233633fc915fc /lib/PublicInbox/TestCommon.pm | |
parent | 38226be5fd4c24885658e00d4ce87ccee663063d (diff) | |
download | public-inbox-934fea5e3b3c4c1ef0cef29477941ebfc44ff7e0.tar.gz |
use "\&" where possible when referring to subroutines
"*foo" is ambiguous in that it may refer to a bareword file handle; so we'll use it where we can without triggering warnings. PublicInbox::TestCommon::run_script_exit required dropping the prototype, however. We'll also future-proof by dropping "use warnings" in Cgit.pm and use the less-ambiguous "//=" in Inbox.pm while we're in the area.
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r-- | lib/PublicInbox/TestCommon.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index b03e93e0..42819179 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -158,7 +158,7 @@ sub _undo_redirects ($) { # 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; } @@ -180,7 +180,7 @@ package $pkg; 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" |