my $defaults = { requires_login => $_{'requires_login'} ? $_{'requires_login'} : 0, template_file => $_{'template_file'} ? $_{'template_file'} : 'template.tmpl', inner_template => '', }; #### sub loadOptions { my $argsref = shift; my $options = shift; for(my $i = 0; $i < @{$argsref};$i+=2) { $options->{lc(${$argsref}[$i])} = ${$argsref}[($i+1)]; } return $options; } #### $defaults = loadOptions([@_],$defaults);