summaryrefslogtreecommitdiff
path: root/t/test.pl
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2010-09-13 19:10:18 -0700
committerFlorian Ragwitz <rafl@debian.org>2010-09-15 18:59:41 +0200
commit140f53691aaf373827763070261a076e87563f46 (patch)
treef573e655f7c48bb6ee8d0d68d1de9bedf737e9d7 /t/test.pl
parent16d4bea688216f67ff66c9d38ff549a8ced03c2d (diff)
downloadperl-140f53691aaf373827763070261a076e87563f46.tar.gz
Shut up "used only once" warnings.
Not very elegant, but it avoids using $^W or warnings.pm.
Diffstat (limited to 't/test.pl')
-rw-r--r--t/test.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/test.pl b/t/test.pl
index 2bf429c11c..eeb71ef8cc 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -546,7 +546,8 @@ sub runperl {
return $result;
}
-*run_perl = \&runperl; # Nice alias.
+# Nice alias
+*run_perl = *run_perl = \&runperl; # shut up "used only once" warning
sub DIE {
_print_stderr "# @_\n";
@@ -824,9 +825,12 @@ sub watchdog ($;$)
goto WATCHDOG_VIA_ALARM;
}
+ # shut up use only once warning
+ my $threads_on = $threads::threads && $threads::threads;
+
# Don't use a watchdog process if 'threads' is loaded -
# use a watchdog thread instead
- if (! $threads::threads) {
+ if (!$threads_on) {
# On Windows and VMS, try launching a watchdog process
# using system(1, ...) (see perlport.pod)