in reply to
How can one call the lowest value of an array by reference?
Here's another option:
use Modern::Perl;
my @values = qw/5 3 2 12 2/;
my @names = qw/Cat Bat Cow Dog Rat/;
my %hash;
push @{ $hash{ $values[$_] } }, $_ for 0 .. $#values;
my $lowest = ( sort { $a <=> $b } keys %hash )[0];
say "Positions of Lowest Value ($lowest) = @{$hash{$lowest}}";
print 'The animal names are: ';
print join ' ', map $names[$_], @{$hash{$lowest}};
Output:
Positions of Lowest Value (2) = 2 4
The animal names are: Cow Rat