in reply to Sorting by Array values, obtaining indices
BTW, creating the list of numbers with qw uses much more memory than if you create then as integers (or floats) on the first place. On a 32 bit machine, an integer value uses 16 bytes, a float 20 and a dual string&number value around 36.use Sort::Key qw(nsortkey); my @vals = (3, 7, 5, 0, 2); my @idx = nkeysort { $vals[$_] } 0..$#vals;
|
|---|