in reply to Re: How to Order an Array's Elements to Match Another Array's Element Order
in thread How to Order an Array's Elements to Match Another Array's Element Order
Just a data point, but an alternative way to generate the hash is to use slice assignment. It is faster than using map if %index_map is to be generated many times, e.g. across data sets.
my %index_map; @index{@array} = (0..$#array);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to Order an Array's Elements to Match Another Array's Element Order
by Eily (Monsignor) on Sep 17, 2019 at 09:40 UTC | |
by swl (Prior) on Sep 17, 2019 at 11:05 UTC |