my @options = ("Home", "About", "Contact",); my %options_menu = ( Home => '/index.cgi', About => '/about.cgi', Contact => 'contact.cgi', ); $tmpl->param( menu_options => [ foreach(@options){ { option_name => "$_", option_link => "$menu_options{$_}", }, } ], );