if you know what keys are allowed you can check for ones that are not allowed
my %allowed = map ( $_ => 1 } qw/ name user host command/; for my $cmd (@commands) { my $badkeys=''; for my $key (keys %$cmd) { unless ($allowed {$key) {$badkeys.=' '.$k} } if ($badkeys) { print 'skipping due to badkeys found:'.$badkeys."\n"; next; } if ($state->{status} eq 'success') { ...
In reply to Re: How best to validate the keys of hashref arguments?
by huck
in thread How best to validate the keys of hashref arguments?
by cbeckley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |