vivomancer has asked for the wisdom of the Perl Monks concerning the following question:
With this code my entire program takes about 20 seconds to run on my test data set and 30 minutes on the real thing. I've tried thismy @taxR = ("PLRV1", "PMTVS", "PVXHB"); my $curEntry = "PMTVS"; if($curEntry ~~ @taxR){ print "do rest of stuff"; }
but the test data takes 3 minutes to run, so the real set would be unusably long. I have draconian IT guys that will never agree to upgrade perl on the Macs, version 5.8.8, so I was hoping you could help me find a replacement method that doesn't take a million years to run.my @taxR = ("PLRV1", "PMTVS", "PVXHB"); my $curEntry = "PMTVS"; if( first { $_ eq $curEntry } @taxR ){ print "do rest of stuff"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need a replacement method for older version of perl
by toolic (Bishop) on Jun 26, 2012 at 21:03 UTC | |
by vivomancer (Initiate) on Jun 26, 2012 at 23:25 UTC | |
|
Re: Need a replacement method for older version of perl
by tobyink (Canon) on Jun 26, 2012 at 21:06 UTC | |
by vivomancer (Initiate) on Jun 26, 2012 at 23:30 UTC | |
|
Re: Need a replacement method for older version of perl
by kcott (Archbishop) on Jun 27, 2012 at 07:09 UTC | |
|
Re: Need a replacement method for older version of perl
by Anonymous Monk on Jun 27, 2012 at 00:13 UTC |