develooper Front page | perl.perl5.porters | Postings from June 2010

[perl #75812] kill $1 broken in 5.12.1

Thread Previous | Thread Next
Todd Rinaldo
June 17, 2010 08:35
[perl #75812] kill $1 broken in 5.12.1
Message ID:
# New Ticket Created by  Todd Rinaldo 
# Please include the string:  [perl #75812]
# in the subject line of all future correspondence about this issue. 
# <URL: >

We've discovered that this snippet will break in perl 5.12

my $pid = "12345  ";
if($pid =~ m/(\d+)/) {
	kill 9, $1;

it dies with this message:
Can't kill a non-numeric process ID at line 7.

The reason appears to be a result of this commit.

Using Devel::Peek, I'm guessing the problem is that IV doesn't get set on a $1 variable?

For some reason I can't understand,  I can make this problem go away if I do 'use 5.12.1' at the beginning of my code. $1+0 also forces kill to work.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About