in reply to Maintaining strict refs while Binding a set of variables to @_ or dying if they are not defined
You could even put the for loop in a separate subroutine and call it from all your subroutines where you want to verify the arguments.sub file_name { my %args; @args{qw/client_number MM DD S/} = @_; for (keys %args) { defined($args{$_}) or die "\$$_ not defined"; } local $"; "I@args{qw/client_number MM DD S/}"; }
|
|---|