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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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


New User

Dec 11, 2006, 8:16 AM

Post #1 of 2 (7152 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


eval {

$deleteBooks->execute($date) if($1);

return 0;

};if($@) { print "$@"; return 1;}


Thaumaturge / Moderator

Jan 8, 2007, 7:34 AM

Post #2 of 2 (7119 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
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