sub do_stuff { # get args from the call my ( %raw_args ) = @_; # build up hash of default arg values my %default_args = ( foo => 'bar', baz => 'quux' ); # now join the two, giving precedence to %raw_args my %args = ( %default_args, %raw_args ); }