K
Kasp
Hi Everyone,
Need some help in Data:umper.
What I want to do is sort this array (@arr) based on the first element of
the sub-arrays.
So I want finally is @sarr = ([3,2], [5,0], [6,3]);
Here is the code:
use Data:umper;
my @arr = ([5,0], [3,2], [6,3]);
print Data:umper->Dump(\@arr);
my @sarr = sort { $a <=> $b} @arr;
print Data:umper->Dump(\@sarr);
TIA
--
Need some help in Data:umper.
What I want to do is sort this array (@arr) based on the first element of
the sub-arrays.
So I want finally is @sarr = ([3,2], [5,0], [6,3]);
Here is the code:
use Data:umper;
my @arr = ([5,0], [3,2], [6,3]);
print Data:umper->Dump(\@arr);
my @sarr = sort { $a <=> $b} @arr;
print Data:umper->Dump(\@sarr);
TIA
--