![]() |
|
"be consistent" | |
PerlMonks |
Would someone mind helping me understand this Perl OO code?by romandas (Pilgrim) |
on Dec 22, 2009 at 15:48 UTC ( #813906=perlquestion: print w/replies, xml ) | Need Help?? |
romandas has asked for the wisdom of the Perl Monks concerning the following question: Note that I do not own this code. I believe I pulled it from CPAN, and that it rightfully belongs to James MacFarlane. If this is incorrect, let me know and I'll attribute it accordingly. I couldn't find where I originally pulled it from. Here are the relevant snippets:
So, from what I see above, Node->new() should be called using 4 arguments. However, when the original author used Node->new(), he did this:
This only uses three arguments. And if you omit one, then it appears the values would suffer a sort of 'one off' error. But.. the code appears to work fine. What gives? Update: Thanks all!
Back to
Seekers of Perl Wisdom
|
|