Just another Perl shrine | |
PerlMonks |
Re: Validating the contents of scalars using an array based listby TGI (Parson) |
on Apr 04, 2003 at 05:24 UTC ( [id://247963]=note: print w/replies, xml ) | Need Help?? |
Try Params::Validate for all your parameter validation needs. You can do something like this:
With this approach you can check for type, regex matching or require that an arbitrary subroutine(s) return true. You may want to consider generating the hash of functions, instead of having it hard coded. Params::Validate is very nice.
In Section
Seekers of Perl Wisdom
|
|