While supporting the "it depends" philosophy the previous respondents have suggested, I'd strongly recommend Method::Signatures (http://search.cpan.org/~barefoot/Method-Signatures-20160315/lib/Method/Signatures.pm). This allows you to set type constraints (http://search.cpan.org/~barefoot/Method-Signatures-20160315/lib/Method/Signatures.pm#Type_Constraints) and value constraints (next section) as well as its other benefits.
Regards,
John Davies
In reply to Re: Is validation of all subroutine arguments overkill?
by davies
in thread Is validation of all subroutine arguments overkill?
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |