
subbareddy
New User
Dec 11, 2006, 8:16 AM
Post #1 of 2
(6419 views)
|
Strange behaviour $1 ... $10...variables scope
|
Can't Post
|
|
Dear PerlGurus, Why this been built like this? Scope of the $1 ... $10 .... variable in the sub functions or next reguler exprsn results checking level is being getting effected and it's strange and dangers check points, if the user dependent on these variables. sub fun1() { $string1 = /(english).*(book).*/i; ... $string2 = 'Hindi'; $returnStatus = &fun2($string2); } sub fun2() { #Delete the books info, if found /(book)/i; eval { $deleteBooks->execute($date) if($1); return 0; };if($@) { print "$@"; return 1;} }
|