my_func(foo => 1, bar => 2); sub my_func { my %args = @_; if ($args{foo}) { ... } # etc... }