Chas. Owens wrote:
On Sun, Apr 13, 2008 at 2:05 PM, Richard Lee <[EMAIL PROTECTED]> wrote:
snip
next if ! /^$start/;
snip
You should say
next unless /^$start/o;
The o makes a promise that $start won't change, so the regex only gets
compiled once (it is recompiling the regex each time through the loop
currently) and unless is easier to see than "if !" when reading code
quickly.
Or better, use the qr// operator to compile $start.
perldoc -q /o
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/