in reply to Rountines

If you only want the min and max of a list of strings, sorting is not very efficient. Check out List::Util, which has a nice minstr and maxstr function. If you want to make only one pass, you can use the C-coded reduce from there, and still get some decent speed:
use List::Util qw(reduce); my $min_max = reduce { my ($min, $max) = ref $a ? @$a : ($a, $a); $min = $b if $min gt $b; $max = $b if $max lt $b; [$min, $max]; } @your_list_here; my($min, $max) = @$min_max;

-- Randal L. Schwartz, Perl hacker