Perl Monk, Perl Meditation | |
PerlMonks |
Re: chaining method callsby EvdB (Deacon) |
on Jun 12, 2003 at 09:22 UTC ( [id://265307]=note: print w/replies, xml ) | Need Help?? |
I am not a fan.
Consider this code:
As the object was created inside the {} it should go out of scope and the memory should be cleared - a good thing. However as object returns a reference to itself it is not cleared, and stays in memory. If the object had just returned true or false this would not be a problem. This may not be a problem if you read the docs for HugeObject but why add the compication for some slightly shorter code? --tidiness is the memory loss of environmental mnemonics
In Section
Meditations
|
|