in reply to Passing by Named Parameter

A really good example can be found in the Bio::Root::RootI module in BioPerl. See the _rearrange function.

This is a helper function used to sort out and make named parameters consistent. It's used as follows:

sub function { my $self = shift; my ($arg1, $arg2, $arg3) = $self->_rearrange([qw(NAME1 NAME2 NAME3)] +,@_); } function( '-name1' => 'value1', '-name2' => 'value2');
It simply avoids repeating the parsing, uppercasing, and dash removal in each function.

~J