sub blah { my ($foo, $bar, $baz) = @_; for my $arg (qw( foo bar baz )) { croak("$arg missing/undefined") if !defined(shift); } ... }