Keep It Simple, Stupid | |
PerlMonks |
Re^3: Bug in substitution operator?by rhesa (Vicar) |
on Jan 10, 2009 at 21:09 UTC ( [id://735432]=note: print w/replies, xml ) | Need Help?? |
update: my example went the wrong way. This is the issue:
versus I think the following quote from perlop under "Gory details of parsing quoted constructs" sheds some light on this quirk:
Note also that the interpolation code needs to make a decision on where the interpolated scalar ends. For instance, whether "a $b -> {c}" really means:or:
I don't see this as a bug. Remember that the right-hand-side of s/// is just a double-quoted string, subject to the usual interpolation rules. The same disambiguation is needed in regular interpolated strings. Consider this snippet:
To fix the syntax error, and get the desired output, you do this:
In Section
Seekers of Perl Wisdom
|
|