Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: search and extract from a large hash

by johngg (Abbot)
on Jun 07, 2011 at 16:16 UTC ( #908521=note: print w/ replies, xml ) Need Help??

in reply to search and extract from a large hash

A few further points to note:-

  • Use the three-argument form of open with lexical file handles and check for success, giving the o/s error on failure, e.g.

    open my $uniqueFH, '<', $uniqueFile or die "open: < $uniqueFile: $!\n";

  • You can do your chomping in one fell swoop

    chomp( my @data_in = <$uniqueFH> );

    rather than piecemeal.

  • You could consider using a hash slice rather than looping although this might not be practicable with very large data sets

    my %strSpec_protein_hash; @strSpec_protein_hash{ @data_in } = @goodProteins_hash{ @data_in };

  • I wonder if you have a cut'n'paste error in your post, my %strSpec; versus $strSpec_protein_hash{$id} = $seq;

I hope these points are helpful.



Comment on Re: search and extract from a large hash
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2015-11-29 10:34 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls