in reply to Re: Extracting coordinates
in thread Extracting coordinates

In cases like this, imo, it may be worth declaring/compiling the regex outside of any loops.
my $re = qr{\s+(-?\d+\.\d+)\s+(-?\d+\.\d+)}; # and then later, inside the loops next if $line !~ $re;
You would need to do benchmarks to know whether it was actually worth it. The docs are a tad cirumspect. :-)

Replies are listed 'Best First'.
Re^3: Extracting coordinates
by Anonymous Monk on Mar 21, 2010 at 10:27 UTC
    You would need to do benchmarks to know whether it was actually worth it.

    No you wouldn't since there is no vars in the regex, it makes no difference.