in reply to Efficiently compare sorted array vs another sorted array and pattern match

why not use a hash instead of an array? untested:
%hash = map { $_ => 1 } @array; open (FILE, $file) or die "blah"; while (<FILE>) { my $key = (split("\t",$_))[2]; next unless ($hash{$key}); # do processing of line here ... }
  • Comment on Re: Efficiently compare sorted array vs another sorted array and pattern match
  • Download Code