Perl: the Markov chain saw | |
PerlMonks |
Re(6): Null objects in boolean contextby Ovid (Cardinal) |
on Jan 01, 2004 at 22:10 UTC ( [id://318170]=note: print w/replies, xml ) | Need Help?? |
mirod wrote: If I use a Null Object I cannot write if( $elt->first_child) {...} anymore. Ovid begs to differ :)
That might need a bit of tuning, but you get the idea. Update: I just noticed that you mentioned overload, so my bit of code is not news to you :) On the other hand, if clean null objects is the only benefit of autoboxing, then I again can't see much of a benefit to them. I might also add that null objects should be the exception rather than the rule, thus the performance impact should be minimal (I hope). Cheers, New address of my CGI Course.
In Section
Meditations
|
|