in reply to Re^2: Object Method Call
in thread Object Method Call
But there is a slightly difference between display($self) and $self->display(), when a class XY inherits from MyTest and implements it's own display() method. display($self) calls MyTest::display() even when invoked on an instance of XY, whereas $self->display() calls XY::display() when invoked on an instance of XY. So, one could say that display($self) breaks inheritance. This is often bad, but sometimes, it can be a useful trick.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Object Method Call
by ikegami (Patriarch) on Jul 27, 2009 at 19:40 UTC | |
by afoken (Chancellor) on Jul 27, 2009 at 19:54 UTC | |
|
Re^4: Object Method Call
by AnomalousMonk (Archbishop) on Jul 27, 2009 at 14:56 UTC | |
by afoken (Chancellor) on Jul 27, 2009 at 19:33 UTC | |
by AnomalousMonk (Archbishop) on Jul 28, 2009 at 06:55 UTC |