- or download this
my @records;
while (<IN>) {
...
# Stick your variables into an array for later use
push @records, [ $NUM, $SEC, $LONG, $LAT ];
}
- or download this
# Sort by LONG (index 0=NUM, 1=SEC, 2=LONG, 3=LAT)
my @sorted_recs = sort { $$records[$a][2] <=> $$records[$b][2] } @reco
+rds;
- or download this
for my $rec (@sorted_recs) {
# pull the variables from the current record
...
print "Num=$NUM, Sec=$SEC, Long=$LONG, Lat=$LAT\n";
}