There is no easy way to do this. Check out Params::Validate or MooseX::Params::Validate.

On May 23, 2010, at 12:06 AM, Andreas Falch wrote:

Hi,

Is there an easy way to add parameter validation to %args?

E.g. based on the example in the Mason book chapter 2, can I mandate that a scalar is one the elements in a list, otherwise an error is thrown?

Pseudo-code:

<%args>
$size => [ 'small', 'medium', 'large']
</%args>

Andreas
--



Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now. ------------------------------------------------------------------------------

_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

------------------------------------------------------------------------------

_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to