The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I could just as well use (and more efficient too): Ummm, no. $& is one of the "ugly three" variables (the other two are $` and $') that kill performance. From perlvar: The use of this variable anywhere in a program imposes a considerable performance penalty on all regular expression matches. To avoid this penalty, you can extract the same substring by using @-. Starting with Perl 5.10, you can use the /p match flag and the ${^MATCH} variable to do the same thing for particular match operations. Apart from that, it may work for this special problem, but it does not work if $& evaluates to false:
Output:
Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-) In reply to Re^3: Text matching repost
by afoken
|
|