in reply to my $1
Why do $1 and $2 behave differently than $_
Do they?
$ perl -e 'my $_ = 1' Can't use global $_ in "my" at -e line 1, near "my $_ "
Hint: use local for global/package variables instead (if you really need to...).
Or, in your case with $1 etc., I think simply creating a local copy of $1 with my $capt1 = $1; would be sufficient for your recursion problem.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: my $1
by grinder (Bishop) on Apr 23, 2009 at 20:34 UTC | |
by codeacrobat (Chaplain) on Apr 23, 2009 at 20:47 UTC | |
by JavaFan (Canon) on Apr 23, 2009 at 22:08 UTC | |
by almut (Canon) on Apr 23, 2009 at 20:44 UTC | |
Re^2: my $1
by ikegami (Patriarch) on Apr 23, 2009 at 20:45 UTC | |
Re^2: my $1
by mltucker (Initiate) on Apr 23, 2009 at 20:49 UTC |
In Section
Seekers of Perl Wisdom