|
|
| more useful options | |
| PerlMonks |
Passing params, as a hash, to mooseby neilwatson (Deacon) |
| on Oct 13, 2012 at 01:25 UTC ( #998808=perlquestion: print w/ replies, xml ) | Need Help?? |
|
neilwatson has asked for the
wisdom of the Perl Monks concerning the following question:
Greetings, I have a moose question. I'm still new to moose. Normally I would pass parameters to a new object thusly.
Suppose that colour and shape are arguments and that they are optional. It seems that if no argument is given via my program the value is ''. This seems to confuse my classes on the moose side where it fails to set the default. My thought was to build the parameter hash before hand so as to pass only the arguments that are defined.
I tried this but nothing seems to make it to moose. Am I on the right track? Is there better way?
Neil Watson
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||