or you could do it like this $maximum = max (@any_array); #(don't use hashes here)
you need to declare the sub max sub max { my $max = shift(@_); for my $item (@_) { $max = $item if $max < $item; } return $max; } this is from the camel book it look prettier to me but that's a matter of taste ;) maybe it's even faster because there's no split or sort involved greetings Remco Schoeman -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: donderdag 27 september 2001 22.04 Cc: [EMAIL PROTECTED] Subject: Max Function I am finding the maximum (Max) of given numbers using this technique. Am I justified using this approach, or there is a straight-forward way to do it in Perl? my(@arrY) = split(",",$yVals); my(@cpyArrY)= sort{$b<=>$a}(@arrY); $yMax = shift(@cpyArrY); thanks in advance, Rex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]