in reply to Remembering original order of an array
Thanks to all who were even beginning to consider this...:-)my $i=0; my @sorted_indexes=map {$_->[1]}sort{ $a->[0] <=> $b->[0] }map{[$_,$i+ ++]}@array; foreach my $d(@sorted_indexes){ print $d."\t".$array[$d]."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remembering original order of an array
by ikegami (Patriarch) on Sep 04, 2007 at 19:27 UTC |