lddzjwwy has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I got a question about the $ variables in Perl, if I have some codes like below:
if(/^\s*(.+)\s*/){ if($1 =~ /\[(\d+)\]/){ ... } }
Is the (\d+) inside the second if $1 or $2?.
It is only a simple example for figuring out what the second (\d+) should be. If there are some syntax errors pls ignore them.
Thanks a lot guys.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl $
by roboticus (Chancellor) on Jun 17, 2013 at 12:32 UTC | |
|
Re: Perl $
by ww (Archbishop) on Jun 17, 2013 at 12:48 UTC | |
|
Re: Perl $1, $2, $3, $4
by Anonymous Monk on Jun 17, 2013 at 12:33 UTC | |
by lddzjwwy (Novice) on Jun 17, 2013 at 12:45 UTC |