Subject: | syntactic sugar: validate_pos(@_, 3, 2) |
Hello,
I'm a new Params::Validate user and I find it very useful. Thanks! I have a suggestion to improve the validate_pos() interface a bit, while still being backwards compatible.
Currenty, as I understand the basic for of validate_pos(), it consists only of a string of 1's followed by a string of zeros. This is hard to read, and this not how I think about it. I think "3 required, 2 optional".
Since only "0" and 1" are the integers used now, I'd like to see this kind of interface
supported:
validate_pos(@_,3,2);
That would mean that the first three fields are required, followed by two optionals. This syntax also prevents this happening by accident(1,0,1,0,1);
Thanks!
Mark