in reply to Re: Sorting array with multiple values per keys
in thread Sorting array with multiple values per keys
It works great but how do I call the first element of the first element in the @Array now? Something like @Array[0]->[0] ? And can I still use foreach operators now? Like:my @Array = ( [1, 5], [6, 2], [3, 4], [3, 9], [8, 1], ); @Array = sort { $a->[0] <=> $b->[0] or $b->[1] <=> $a->[1] } @Array;
foreach @Elements (@Array) { print @Elements[0]."x".@Elements[1]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sorting array with multiple values per keys
by ikegami (Patriarch) on Aug 13, 2008 at 01:21 UTC | |
|
Re^3: Sorting array with multiple values per keys
by betterworld (Curate) on Aug 13, 2008 at 01:41 UTC |