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

Report information
The Basics
Id:
59316
Status:
rejected
Priority:
Low/Low

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

BugTracker
Severity:
Wishlist
Broken in:
(no value)
Fixed in:
(no value)



Subject: Params::Validate could protect against typos in code accessing the params hash
Params::Validate is very handy. It does a great job of validating the arguments. With a simple change it could also do a great job of protecting against typos in code accessing the params hash: add a lock_keys option to validation_options() that would call Hash::Util lock_keys() on the hash ref returned when validate() is called in scalar context. Then an error would be raised when any code accesses the parameter hash with an incorrect key name. p.s. Performance could be improved if users cached the hash ref passed to validate() instead of recreating it each time. e.g., validate(@_, state $param_spec = { ... }); It would be handy if the docs noted this and also noted if/when Params::Validate alters the hash (hopefully it doesn't).
I'm no longer going to make any non-bugfix changes to P::V so I'm closing old wishlist tickets.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.