in reply to How to make a hash to evaluate columns between large datasets

Hello and welcome. Can you pls give an indication of how many keys would need to be available from the reference file?
  • Comment on Re: How to make a hash to evaluate columns between large datasets

Replies are listed 'Best First'.
Re^2: How to make a hash to evaluate columns between large datasets
by rambosauce (Novice) on Aug 23, 2018 at 12:56 UTC
    Hi Thelonius. I would need to compare four keys in in the reference, and if those four match, return only an additional key which is the final column.
      In this case you just need to put the reference information in a hash from the reference file and use that for look up instead of an array. A hash has the syntax
      my %hashname = (); # init empty hash $hashname{key1} = "value1"; $hashname{key2} = { x => 'y' }; # nests an anonymous hash as the value + for key2
      often you want to store a hash reference in a scalar to avoid referring to the entire hash, e.g. :-
      my $href = \%hash;
      hope this helps