|
|
| more useful options | |
| PerlMonks |
Re^10: Global regex giving up too soonby Coruscate (Sexton) |
| on Jan 20, 2004 at 08:18 UTC ( [id://322579]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
1 while $str =~ s/PAT/REPL/; Why not just $str =~ s/PAT/REPL/g;? Gives same result... $str =~ s/A/a/i for 1,2,3; All this really shows is that without 1 while or the /g modifier that it always matches at the beginning again during reiteration... I don't mean to be rude, but you didn't really demonstrate anything too revealing :) I'm looking for a case where there is a difference between 1 while s/foo/bar/ and 1 while s/foo/bar/g.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||