It has been said before that this code is "too simple" for CPAN, but I must disagree. I have seen people write this kind of code over and over again and they always get it wrong. Perhaps now they will spend more time getting the rest of their code right...-- Leon Brocard in the notes of Data::Page
All the errors, mistakes, and cryptic golfing in this thread, along with the fact that you will need to do this more than once imply you need a modular, re-usable solution.
The software engineering approach is to use Params::Validate or a newer related module.
-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"
In reply to DWIM code would use Params::Validate
by metaperl
in thread Correct idiom for default parameters
by mrider
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |