CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
Strange behaviour $1 ... $10...variables scope

 



subbareddy
New User

Dec 11, 2006, 8:16 AM

Post #1 of 2 (2489 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;}



}


davorg
Thaumaturge / Moderator

Jan 8, 2007, 7:34 AM

Post #2 of 2 (2456 views)
Re: [subbareddy] Strange behaviour $1 ... $10...variables scope [In reply to] Can't Post

Please explain exactly what problems you are having. Your current question isn't very clear.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives