in reply to Passing by Named Parameter
This is a helper function used to sort out and make named parameters consistent. It's used as follows:
It simply avoids repeating the parsing, uppercasing, and dash removal in each function.sub function { my $self = shift; my ($arg1, $arg2, $arg3) = $self->_rearrange([qw(NAME1 NAME2 NAME3)] +,@_); } function( '-name1' => 'value1', '-name2' => 'value2');
~J
|
|---|