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

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.
  • Comment on Re^2: How to make a hash to evaluate columns between large datasets

Replies are listed 'Best First'.
Re^3: How to make a hash to evaluate columns between large datasets
by TheloniusMonk (Sexton) on Aug 23, 2018 at 13:32 UTC
    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