Just another Perl shrine | |
PerlMonks |
Re: Regex Question in Perlby ikegami (Patriarch) |
on Dec 22, 2010 at 18:29 UTC ( [id://878627]=note: print w/replies, xml ) | Need Help?? |
The "?" in ".*?" makes ".*" matches as few characters as possible. Get rid of it. Furthermore, the "g" in if (/.../g) makes no sense conceptually (check if there's a match, then check again to be sure?) or in practice (it has weird side effects). Get rid of it. I dislike using global variables for no reason, so I'd write it
In Section
Seekers of Perl Wisdom
|
|