> $1 is magic, so until SvGETMAGIC() is called it has no flags. > > Patch calls SvGETMAGIC() before checking the flags, and uses the no > magic variant of SvIV() avoid to double magic. > > looks_like_number() can also call SvGETMAGIC() via SvPV_const(), but > that's a different problem. > > Tony > From 322ed3e750982361473addd7d45edcbace447752 Mon Sep 17 00:00:00 2001 > From: Tony Cook <tony@develop-help.com> > Date: Thu, 17 Jun 2010 18:58:04 +1000 > Subject: [PATCH] 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. Any idea why use 5.12.1 makes it so kill $1 doesn't break? use 5.12.1; my $pid = "12345 "; if($pid =~ m/(\d+)/) { kill 9, $1; }Thread Previous | Thread Next