in reply to max value in a hash

Hi, while you already got a solution for your problem I would like to comment on your code. You seem to use a foreach loop only to abort it in the first iteration which you don't really have to in Perl. It looks very C'ish to me.

First, instead of:

my $i = 0; foreach (sort sortHash (keys (%hashName))) { if ($i == 0) { $max = $hashName{$_}; last } } # end-foreach
you could write:
foreach (sort sortHash (keys (%hashName))) { $max = $hashName{$_}; last; } # end-foreach
because there is no need for the $i when you just check for 0.

Second, even easier in Perl, you can index returned lists when you put them in ( ):

my $max = ( sort sortHash (keys (%hashName)) )[0]; # also possible: my $min = ( sort sortHash (keys (%hashName)) )[-1];
or simply by doing an array assignment:
my ($max) = sort sortHash (keys (%hashName));
also the ( ) around and after keys aren't necessary and avoiding them would make the code more readable.