rinceWind has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using pseudohash for argument list validation
by particle (Vicar) on Apr 28, 2002 at 12:30 UTC | |
|
(crazyinsomniac) Re: Using pseudohash for argument list validation
by crazyinsomniac (Prior) on Apr 29, 2002 at 09:51 UTC |