Perl Monk, Perl Meditation | |
PerlMonks |
Re: substituting constants within regex?by Zaxo (Archbishop) |
on Jul 09, 2007 at 07:55 UTC ( [id://625577]=note: print w/replies, xml ) | Need Help?? |
When you use constant Foo . . . , 'Foo' becomes the name of a sub. Inside a regex, you need to use a form which makes the sub be called by evaluation. The \Q is not helping, either. It looks like you're dealing with foreign line ends, so you might do better to set $/ to CRLF or whatever and chomp. In a substitute string, the /e modifier would be needed to call the sub. After Compline,
In Section
Seekers of Perl Wisdom
|
|