in reply to Looking for ways to speed up the parsing of a file...
with a hash (e.g. %Nets) containing the above values andif (($TotalNets == 50000) || ($TotalNets == 100000) || ($Total +Nets == 250000) || ($TotalNets == 500000) || ($TotalNets == 1000000) +|| ($TotalNets == 1500000) || ($TotalNets == 2000000) || ($TotalNets +== 3000000)) {
I like pc88mxer suggestion, but I notice that (for example) 150,000 is not in your test, so modulo 50,000 would give you a false positive.if ( $Nets{$TotalNets) ) {
Another suggestion would be to replace
with$_ =~ s/^ *//; $_ =~ s/ *$//; @DriverLine = split (/\s+/,$_);
@DriverLine = split( /\s+/, (( /^\s*(\S.*)\s*$/ ) ? $1 : $_ ) );
The code hasn't been tested, and I can't swear to the efficiencies.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looking for ways to speed up the parsing of a file...
by Anonymous Monk on May 17, 2008 at 23:41 UTC | |
|
Re^2: Looking for ways to speed up the parsing of a file...
by Anonymous Monk on May 17, 2008 at 22:01 UTC | |
by Anonymous Monk on May 17, 2008 at 22:15 UTC |