#!/usr/bin/perl use strict; use warnings; my @list = qw(4 78 3 89 4 1000 5); my %minimum; for my $index ( 0 .. $#list ) { @minimum{ qw(index min) } = ($index , $list[$index]) if ! %minimum; if ( $list[$index] < $minimum{min} ) { @minimum{ qw(index min) } = ($index , $list[$index]); } } print "The index of the smallest number is : $minimum{index}\n"; print "The valud of the smallest number is : $minimum{min}\n";