in reply to Re^2: Which data structure should I use?
in thread Which data structure should I use?

So, in the code you suggest, ID won't be used at all

It's there, just not used as the index.

However, how would you use the code you provide

The output of Data::Dumper illustrates that quite well.

If I gave you $wanted_second_number=9, how would you print $first_number=6?

No really, look at the structure yourself before continuing.

my @matching_recs = $grouped_by_num2{$wanted_second_number}; for my $rec (@matching_recs) { my $first_number = $rec->{FIRST_NUMBER}; print("$first_numner\n"); # 5, 6 }