Hi,
I have an array of hashes of arrays of arrays... I want to sort the arrays in the array of arrays in a specific hash according to the first element in each array.
This seems to work:
my @sorted = sort { $$a[0] <=> $$b[0] } @{$simulations[$simulation_in +dex]->{"SPECIAL"} }; $simulations[$simulation_index]->{"SPECIAL"} =\@sorted;
but the following, which for me seems the same (except without the temporary @sorted) - returns "Odd number of elements in anonymous hash at..."
$simulations[$simulation_index]->{"SPECIAL"} = \{sort {$$a[0] <=> $$b[ +0] } @{$simulations[$simulation_index]->"SPECIAL"} }};
In reply to Odd number of elements in anon hash by roibrodo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |