XP is just a number | |
PerlMonks |
Using pseudohash for argument list validationby rinceWind (Monsignor) |
on Apr 28, 2002 at 10:42 UTC ( [id://162645]=perlquestion: print w/replies, xml ) | Need Help?? |
rinceWind has asked for the wisdom of the Perl Monks concerning the following question:
Monks, There has been much discussion recently about argument passing, see Shift versus Sanity and Sub::HashWrap. Glancing at the Camel book, I was reminded of the pragmatic module use fields in the context of validating data fields in an object at compile time. The underlying mechanism used is a pseudohash. I was wondering whether something similar could be used for named arguments to a sub or method, detecting typos at compile time. I also understand that phashes are an experimental feature from 5.5 on, which could change. Are they here to stay? Are they OK so long as you use fields::phash? Thoughts please. --rW
Back to
Seekers of Perl Wisdom
|
|