RE: signals versus vfuncs



On Wed, Jan 21, 2004 at 12:00:21PM -0500, Murray Cumming wrote:
> Does perl actually have the concept of virtual functions? I mean, if I
> have virtual function on_something() in the base class, and I override
> on_something in a derived class, if I call on_something from
> A::something_else() when the instance is actually an instance of B, will
> it call B::something_else() or A::something_else()? This is what C++
> does when you use the "virtual" keyword on methods, and what Java does
> by default.

Perl will call the subclass's method in the above case.

-- 
Gaal Yahas <gaal forum2 org>
http://gaal.livejournal.com/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]