The stupid question is the question not asked | |
PerlMonks |
Re: matching / splitting within a substitutionby jsprat (Curate) |
on Jul 14, 2003 at 23:02 UTC ( [id://274217]=note: print w/replies, xml ) | Need Help?? |
A quick trip through Deparse shows that perl changes the substitution to this:
Note that the backslashes were removed from the regexes! On a hunch, I changed the second set of delimeters from square brackets to curly brackets, the output is as you expected originally. Update: perl 5.8.0 (ActiveState build 806) on Win2K Update: The more I think about it, I don't consider this a bug. If you use double-quotes to delimit a string ("\"Hello\""), backwhacking the delimiter results in the double quote as part of the string. The same should hold for square brackets as a delimiter.
In Section
Seekers of Perl Wisdom
|
|