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 reply to Re: Optimization for readability and speed (code) by merlyn
in thread Optimization for readability and speed (code) by deprecated

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":