in reply to Odd number of elements in anon hash
For one, you're missing a curly before "SPECIAL". But I think you rather want
$simulations[$simulation_index]->{"SPECIAL"} = [ sort {$$a[0] <=> $$b[ +0] } @{$simulations[$simulation_index]->{"SPECIAL"} } ];
i.e., the anonymous array [ ... ] would correspond to your original \@sorted.
What you have is a reference to a hashref (\{ ... }), where the anonymous hash complains when initialized with an odd number of elements from the sort results.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Odd number of elements in anon hash
by roibrodo (Sexton) on Jun 01, 2010 at 13:32 UTC | |
by almut (Canon) on Jun 01, 2010 at 13:38 UTC | |
by GrandFather (Saint) on Jun 01, 2010 at 23:42 UTC |