in reply to Sorting arrays and maintaining an index
so you can keep the index even if the data is the same, you could also lowercase the data in the hash keys and grab the original data out of the original array with the index value. The secret is push the values onto the hash as an array, so you get all your dupes...for(my $i = 0; $i <= $#Sort_by; $i++) { push @{$sort{$Sort_by[$i]}} = $i; } for $key (sort { sort code } keys %sort) { for(@{$sort{$key}}) { print "Index: $_ - Data: $key\n"; } }
I'm not sure if that's what you want or not
- Ant
|
|---|