in reply to Re: Bug or feature? s/// and the g option
in thread Bug or feature? s/// and the g option
Interesting. So a failed match will clear the $1 variable.
I'm still a little stumped by Marco's original example:
--rjk
That fails. But remove the "i" in the substitution and $1 is defined. Why would case-insensitive make any difference?$test = <<'END'; XXWY XXWZ END $count = $test =~ s#(XXW?Y)##gi; print "REMOVED: <<$1>>\nCOUNT: $count\n";
--rjk
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Bug or feature? s/// and the g option
by ysth (Canon) on Oct 14, 2007 at 19:46 UTC | |
by Belgarion (Chaplain) on Oct 14, 2007 at 20:14 UTC |
In Section
Seekers of Perl Wisdom