in reply to Assigning AoH pairs by value other AoH's

Depending on how you want the data displayed, you might consider using HTML::Templates's LOOP function by changing the gender to 1 and 0 instead of 'M' and 'F'

my $AoH = [ { name => "Bob", gender => 1 }, { name => "Sue", gender => 0 }, { name => "Mike", gender => 1 } ]; $template->param( ARRAY => $AoH, ); .tmpl file... <TMPL_LOOP NAME=ARRAY> <!-- males --> <TMPL_IF NAME="gender"><TMPL_VAR NAME=name> .... <TMPL_ELSE> <!-- females --> <TMPL_VAR NAME=name> <TMLP_IF> </TMPL_LOOP>