Is there any current or planned way to declare parameter
validation in an <%args> block? Or in some other block?
Maybe I missed this in the book.
That is, I want to do stuff like this:
<%args>
$foo => 1 , qr/^\d$/
$bar => , sub { shift->isa('Bar') } # req'd, no default?
@biz => , !grep $_ eq 'baz', @_
</%args>
Right now I do something akin to this:
<%args>
$foo => 1
$bar
@biz
</%args>
<%perl>
die('bad params')
if $foo !~ m{ \A \d \z }xms
|| !$bar->isa('Bar')
|| grep $_ eq 'baz', @biz;
</%perl>
Mark
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users