Posted by Everett, Toby on 1999-11-22
You want (yay!!! a user for my stuff:) Class::SelfMethods. I think. The critical line there was a new _object_, not class. You want instance definable methods, am I correct? So that you don't have to create a bajillion classes, each of which will only have one instance. Right? Basically, Class::SelfMethods is just some syntactic sugar to make anonymous subroutines stored in the hash for an instance accessible like normal methods. Take a look at http://www.perl.com/CPAN-local//modules/by-module/Class/Class-SelfMethods-1. 06.readme <http://www.perl.com/CPAN-local//modules/by-module/Class/Class-SelfMethods-1 .06.readme> to see if it might be of use, and grab http://www.perl.com/CPAN-local//modules/by-module/Class/Class-SelfMethods-1. 06.tar.gz <http://www.perl.com/CPAN-local//modules/by-module/Class/Class-SelfMethods-1 .06.tar.gz> if it looks like it is. --Toby Everett -----Original Message----- From: Frank Hale [SMTP:frankhale@xxxxx.xxx] Sent: Saturday, November 20, 1999 3:11 PM To: DunniganJack.Dunnigan@xx.xx.xx; ptk@xxxxx.xxxxxxxx.xxx; tcg@xxxx.xx.xx Subject: RE: Does Perl have virtual functions? > 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 ========================================================================== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to majordomo@xxxxx.xxxxxxxx.xxx
Previous post | Next post | Timeline | Home