in reply to Re^3: Code optomization
in thread Code optomization

I'm sorry, I don't understand. Can you explain a bit more? ----
Guns don't kill people, ninjas do.

Replies are listed 'Best First'.
Re^5: Code optomization
by sgifford (Prior) on Jul 09, 2004 at 04:46 UTC
    The problem is that you're trying to do a pattern match against an undefined variable (if the regex doesn't match, or doesn't match enough, $3 will be undefined). My solution drops out of the "loop" immediately in this case, so it never tries to do the pattern match. Roy Johnson's solution avoids entering the loop at all if $3 is undefined.