in reply to Bug or feature? s/// and the g option
Would you expect any intermediate results ?! I think not, and so I wouldn't expect anything from $1,$2,... after a s//g, similar to like I don't really trust for example a for-loop control variable to be something I can rely on once the loop has finished. I remain curious about what others think/know about it.my $test = 'AAAA'; my $x1 = $1 if $test =~ s/A/AA/g; my $x2 = $1 if $test =~ s/A/AA/g; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Bug or feature? s/// and the g option
by ikegami (Patriarch) on Oct 14, 2007 at 18:49 UTC | |
by Krambambuli (Curate) on Oct 14, 2007 at 21:12 UTC |