It's much less verbose than what you're doing,...
Personally I don't see that. I have looked at Params::Validate before, and I didn't much care for it's style of parameter handling. Even if this is in XS, I would think it wouldnt be faster than a raw boolean. Already in your example there is a subroutine call (validate_pos) as well as the construction and analysis of nested hash ref (which is surely pretty fast if in XS), and then the creation of a code-ref (which I assume brings along the overhead of creating a closure, although I may be wrong in this). This seems to me to be a lot of overhead just to get to the point at which things can be checked.
I think that consistently using this module makes your code even more declarative.
I disagree, I think the more declarative approach is to use the basic boolean expression. But that is likely just a matter of personal preference/style.
In reply to Re^2: Being more Assert-ive with Perl
by stvn
in thread Being more Assert-ive with Perl
by stvn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |