in reply to Re: Sort array using a ranking system from separate hash
in thread Sort array using a ranking system from separate hash
Thank you Rolf. I am looking to order the elements of, say, a single array according to a list determined held separately. So, if my original array was ordered
@array = (ATVELLSFL, QLFHLCLII, YLVSFGVWI, MQLFHLCLI);
and my order preference is
MQLFHLCLI FLPSDFFPS YLVSFGVWI LLWFHISCL QLFHLCLII IISCSCPTV ELMNLATWV HISCLTFGR ATVELLSFL
then my array should be re-ordered
@orderedArray = (MQLFHLCLI, YLVSFGVWI, QLFHLCLII, ATVELLSFL);
The length of the array to ordered will always be shorter than the my order preference list, because this list is used with a large number of different arrays
Apologies for not explaining my question properly in the first place
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sort array using a ranking system from separate hash
by haukex (Archbishop) on Aug 08, 2016 at 10:41 UTC | |
by Sandy_Bio_Perl (Beadle) on Aug 08, 2016 at 10:48 UTC | |
|
Re^3: Sort array using a ranking system from separate hash
by LanX (Saint) on Aug 08, 2016 at 10:36 UTC |