Hi Jenn,

You can fing max and min value as,

my @ar = (1,2,3,4,58,9,2,1);
my $max = (sort { $b <=> $a } @ar)[0];
my $min = (sort { $a <=> $b } @ar)[0];

Regards
Sheela
On Wed, Jul 22, 2009 at 12:48 PM, Jenn G. <practicalp...@gmail.com> wrote:

> Hello,
>
> How to lookup the max and min value in an array?
> Just like SQL's max() and min() functions.
>
> Thanks.
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to