in reply to Correct idiom for default parameters
Test::new() is pretty un-Perl/OO way to get an object made. Object constructors are generally called as class or objects methods: Test->new([args]). Then you'd have an _init methods to process the args to new or later in other calls where they are allowed. I hope you are not really using the name "Test" for your package. :)
I find >2 arguments to be the tipping point for making named arguments much preferable to positional. What MidLifeXis showed is a good way to go about that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Correct idiom for default parameters
by mrider (Beadle) on Apr 28, 2010 at 18:33 UTC | |
|
Re^2: Correct idiom for default parameters
by JavaFan (Canon) on Apr 29, 2010 at 09:45 UTC | |
by Your Mother (Archbishop) on Apr 29, 2010 at 14:07 UTC | |
by Anonymous Monk on Apr 30, 2010 at 09:06 UTC | |
by Anonymous Monk on Apr 30, 2010 at 09:42 UTC | |
by LanX (Saint) on Apr 30, 2010 at 11:51 UTC | |
by JavaFan (Canon) on Apr 30, 2010 at 22:10 UTC |