summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2010-06-17 18:58:04 +1000
committerTony Cook <tony@develop-help.com>2010-06-25 21:48:38 +1000
commit8af710ebc7fee929ae47793d5a0cce5362af52db (patch)
tree38dcecb27b35c322bb9e0a57d36ac4858951719c /t/op
parent133acf7b389614db651d1ed570d4a0ca0c747999 (diff)
downloadperl-8af710ebc7fee929ae47793d5a0cce5362af52db.tar.gz
RT #75812: apply get magic before checking flags, PVX
The code was checking flags with applying any get magic, so when a match was doing putting a numeric string into $1, none of the flags checked were set, so producing the "non-numeric process ID" error.
Diffstat (limited to 't/op')
-rw-r--r--t/op/kill0.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/kill0.t b/t/op/kill0.t
index eadf15dc36..d3ef8f7799 100644
--- a/t/op/kill0.t
+++ b/t/op/kill0.t
@@ -14,7 +14,7 @@ BEGIN {
use strict;
-plan tests => 5;
+plan tests => 6;
ok( kill(0, $$), 'kill(0, $pid) returns true if $pid exists' );
@@ -43,3 +43,10 @@ for my $case ( @bad_pids ) {
like( $@, qr/^Can't kill a non-numeric process ID/, "dies killing $name pid");
}
+# Verify that killing a magic variable containing a number doesn't
+# trigger the above
+{
+ my $x = $$ . " ";
+ $x =~ /(\d+)/;
+ ok(eval { kill 0, $1 }, "can kill a number string in a magic variable");
+}