sub foobar { my %arg = @_; my ($foo, $bar) = @arg{qw/ -foo -bar /}; # .. } #### my ($foo, $bar, %arg) = @_; my ($baz, $quux) = @arg{qw(baz quux)}; #### sub moo { my $self = shift; my ($foo, $bar) = @$self{qw(foo bar)}; # .. }