#!/usr/bin/perl use strict; use Class::ParmList qw (simple_parms parse_parms); my_sub( handle => 'Test', 'thing' => 'something'); other_sub( handle => 'Test', 'other' => 'oops'); sub my_sub { my ($handle, $thing) = simple_parms([qw(handle thing)], @_); print "HANDLE: $handle\nTHING: $thing\n"; } sub other_sub { my ($handle, $thing, $other) = parse_parms( -parms => \@_, -legal => ['handle','thing'], -required => ['other'], -defaults => {'thing' => 'uncle'}, )->get('handle','thing','other'); print "HANDLE: $handle\nTHING: $thing\nOTHER: $other\n"; }