Skip Menu |

This queue is for tickets about the Params-Check CPAN distribution.

Report information
The Basics
Id: 118268
Status: new
Priority: 0/
Queue: Params-Check

People
Owner: Nobody in particular
Requestors: NHORNE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.38
Fixed in: (no value)



Subject: Action on unhandled argument
Is there a way to handle arguments that aren't on the list - that would catch typos, something like: my $tmpl = { firstname => { required => 1, defined => 1 }, lastname => { required => 1, store => \$x }, default => sub { warn "unexpected argument $_" }, };
On Wed Oct 05 12:45:38 2016, NHORNE wrote: Show quoted text
> Is there a way to handle arguments that aren't on the list - that > would catch typos, something like: > > my $tmpl = { > firstname => { required => 1, defined => 1 }, > lastname => { required => 1, store => \$x }, > default => sub { warn "unexpected argument $_" }, > };
Probably should be 'unknown' not 'default' to be consistent with $ALLOW_UNKNOWN