my @arr = (1,10,10,20,0x47,30,45,45); sub do_it_all { my $biggest = $_[0]; ... my $smallest = $_[0]; ... }