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
In Section
Seekers of Perl Wisdom