We don't bite newbies here... much | |
PerlMonks |
Re^2: Showing why a Regexp didn't matchby hipowls (Curate) |
on Apr 12, 2008 at 02:05 UTC ( [id://679915]=note: print w/replies, xml ) | Need Help?? |
Generally you should avoid using $', $& and $'. Once they appear in your program they slow down all regular expression calls.This is true and good advice but if you are using perl 5.10.0 or later there is the option of using /P and the variables ${^PREMATCH}, {$^MATCH}, and ${^POSTMATCH} where the cost is confined to only the regular expressions that use them. In this case, though, there doesn't appear to be any advantage to using /P.
In Section
Seekers of Perl Wisdom
|
|