Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Efficiently compare sorted array vs another sorted array and pattern match

by eXile (Priest)
on Apr 09, 2005 at 04:46 UTC ( [id://446218]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://446218]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-24 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found