#!/usr/bin/perl use strict; use Params::Smart; my_sub( handle => 'Test', 'thing' => 'something'); sub my_sub { my %args = Params(qw(handle thing ?other))->args(@_); print "HANDLE: $args{handle}\nTHING: $args{thing}\nOTHER: $args{other}\n"; }