in reply to How do I record in what order a sort was preformed
my $count = 0; my %hash = map {$_, $count++} @array; my @sort = sort { int($a) <=> int($b) } @array; my $flag = 0; for (@sort) { print ', ' if $flag++; print qq|"$_" came from | . '$array[' . $hash{$_} . ']'; }
--Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I record in what order a sort was preformed
by trs80 (Priest) on Jan 18, 2002 at 02:52 UTC |