good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Optimization for readability and speed (code)by merlyn (Sage) |
on Apr 30, 2001 at 22:17 UTC ( [id://76690]=note: print w/replies, xml ) | Need Help?? |
Augh! I'd scream if I had to maintain that code!
Write it as mostly a single regular expression. You are using a number of very un-perl-like things. The fact that you have to set $" should be the first clue. Writing it as a single regular expression will almost certainly speed it up as well. You're making Perl do all the things it hates doing. I know, I've had many chats with Perl. {grin} -- Randal L. Schwartz, Perl hacker
In Section
Seekers of Perl Wisdom
|
|