in reply to Newbie help, again

The sort you choose depends on how your data is structured. Have a look at sort and see if that is of any assistance.

If you use a list of lists, you can do something like: my @sorted = sort { $a[0] cmp $b[0] } @records; If you use a list of hashes, you could do: my @sorted = sort { $a{TYPE} cmp $b{TYPE} } @records; If you're using just an array... you're in for more trouble, and you might want to look at using SQL commands with the DBI module from CPAN.