Coder's Guild Mailing List

RE: Does Perl have virtual functions?

Posted by Frank Hale on 1999-11-20

> PS...Is this a Tk thing??

Yes its a Tk thang!

Description of the problem:

Okay this is what I am doing. I've already written
some little Perl/Tk apps to grab headlines from
various websites on the internet. They all have a
common interface. The only major difference between
each app is the method which parses the headlines and
adds them to the list box. I've created a module which
has the core GUI stuff in it for the creation of these
apps. Now when I declare an object I want to define
its parse_headlines method so that it can download the
headlines from an arbitrary site. What I am aiming to
do is make it simple to create such little apps by
encapsulating the GUI inside a module and only having
to write just a little more code to create new
headline grabber apps.

I am not sure if virtual functions is what I am
looking for, probably more along the lines of a
callback because the way the module is coded now it
calls a method parse_headlines() which is an empty
method. It will only be defined when I create a new
object of this class.


__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com