in reply to Re: Returning indices with same values for array within hash.
in thread Returning indices with same values for array within hash.

... each ... newer Perl ...

Perl version 5.12+, and 5.14+ has the "highly experimental" feature of allowing each to directly take a reference:

>perl -wMstrict -le "my %matrix = (NI => [2, 1, 1, 3, 4] ); ;; my @NI_index; my $min; while (my ($i, $v) = each $matrix{NI}) { if(not defined $min or $v < $min) { $min = $v; @NI_index = (); } push @NI_index, $i if $v == $min; } print qq{@NI_index}; " 1 2