in reply to search and extract from a large hash

If I read your code correctly, you only need this:

foreach (@data_in) { chomp; $strSpec_protein_hash{$_} = $goodProteins_hash{$_}; }

This is exactly what hashes are good at and your loop is in a way removing that advantage again ;-)

Replies are listed 'Best First'.
Re^2: search and extract from a large hash
by reubs85 (Acolyte) on Jun 07, 2011 at 13:43 UTC

    Holy crap, you have no idea how much time that will save me!! I suspected all along that I was doing something daft, but I'm still getting to grips with Perl so once I'd found a way that worked i was reluctant to fiddle...

    Thanks again man

    Reuben

Re^2: search and extract from a large hash
by jwkrahn (Abbot) on Jun 07, 2011 at 18:15 UTC

    Or just this:

    chomp @data_in; @strSpec_protein_hash{ @data_in } = @goodProteins_hash{ @data_in };