laziness, impatience, and hubris | |
PerlMonks |
Re: fixstyle script in PERL COOKBOOKby sachmet (Scribe) |
on Apr 14, 2001 at 02:09 UTC ( [id://72504]=note: print w/replies, xml ) | Need Help?? |
That is odd...
Output: So it seems that method won't work correctly. Perhaps another Monk can enlighten. Corion suggests that \Q$var\E should work as normal; perhaps change the line that reads: $code .= "s{\\Q$in\\E}{$out}g" to read: $code .= "\$var=quotemeta q{$in}; s{\$var}{$out}g" for all to be well with the world. And it appears to, as well. Update:D'oh, messed up the replacement line,fixed Update:Corion once again points out that the reason for this is because @b gets interpolated before \Q takes effect. I should have realized this was the case.
In Section
Seekers of Perl Wisdom
|
|