my $ret_val;
my $i; if ($#your_array < 0){ ## do appropriate thing } elsif ($#your_array == 0){ ## return the only value it has} ## following is the ELSE part for (my $i = 0; i < $#your_array; ++i) { $ret_val = your_array[i+1]; $ret_val = your_array[i] if (your_array[i] > your_array[i+1]); } ## $ret_val contains the max number. --------------------------------- Get a bigger mailbox -- choose a size that fits your needs.