[mplspm]: Params::Validate question

Brian Parker bparker at pobox.com
Mon Oct 14 13:51:52 CDT 2002


Hi,

I would like to subclass Params::Validate so that the default option for
the 'on_fail' "Global" option is something like this:

'on_fail' => sub { require IllegalArgumentException;
IllegalArgumentException->throw(message=>$_[0]); }

... where 'IllegalArgumentException' is a subclass of
'Class::Exception'.  I can see from the docs that the recommended way to
do this is to call 'Params::Validate::validation_options' from each
module that 'uses' Params::Validate, but I rather make the change in one
place (we have over 100 .pm files).  I suppose I could hack
Params::Validate to change the default, but I don't like doing that
either.  Can anybody recommend a better way?

regards,
Brian


--------------------------------------------------
Minneapolis Perl Mongers mailing list

To unsubscribe, send mail to majordomo at pm.org
with "unsubscribe mpls" in the body of the message.



More information about the Mpls-pm mailing list