in reply to sorting/output
The approach you probably want to use is to create a reshref for each record, and then sort those by distance. i.e.
while (<LINE>) { @fields = split; my $record = { ra => ..., prob => ..., dist => ..., }; push @records, $record; } sub by_distance { $a->{dist} <=> $b->{dist} } @records = sort by_distance @records;
You can then iterate ocver the records, and print them.
|
|---|