for my $rec (@sorted_recs) { # pull the variables from the current record my ($NUM, $SEC, $LONG, $LAT) = @$rec; print "Num=$NUM, Sec=$SEC, Long=$LONG, Lat=$LAT\n"; }