sub blah { my ($foo,$bar,$baz) = @_; for my $arg (\$foo,\$bar,\$baz) { if ( !defined($$arg) ) { croak "You forgot something!\n"; } } ... }