in reply to Assigning AoH pairs by value other AoH's
my $template->param( men => [ grep { $_->{gender} eq 'M' } @$AoH ], women => [ grep { $_->{gender} eq 'F' } @$AoH ], );
Given the phrasing of the question, I think this maps very closely to the way you are asking the question. Granted, it scans through your @$AoH twice, which makes it a little less efficient than other methods, but it does map very closely to the way you are thinking of your problem by what you asked.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Assigning AoH pairs by value other AoH's
by bradcathey (Prior) on Sep 10, 2005 at 18:25 UTC |