Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Use method/function signatures with Perlby radiantmatrix (Parson) |
on Dec 06, 2004 at 17:09 UTC ( [id://412698]=note: print w/replies, xml ) | Need Help?? |
This is kind of cool, but I've been severely bitten by source filters in the past, and continue to have a number of personal stylistic issues with using them. What I'd like to see (and if someone knows of a CPAN module that does this, I'd be grateful) is something that would allow subs to be written thusly:
That is, I'd really like to see verification of parameter types handled by a verifier object rather than by a source filter. Yes, I know it's not quite the same thing; but by eval'ing the type verifier call, one could achieve the same basic functionality. Update: It turns out, thanks to a mention by dragonchild and xdg, that Params::Validate does just the above. An example of the above code, but using that CPAN module, can be found a bit further down in this discussion.
radiantmatrix
In Section
Meditations
|
|