|Just another Perl shrine|
Very basic package / module question...by smullis (Pilgrim)
|on Feb 05, 2010 at 15:10 UTC||Need Help??|
smullis has asked for the wisdom of the Perl Monks concerning the following question:
It's been years since I posted here... I've been away with the fairies in Python and Ruby land for so long I've forgotten almost everything I ever knew about Perl OO...
I have no doubt that the following question is extremely basic..
I want to extend a class for a Perl API with one additional method.
I have the method but I don't want to edit the core API files. I would like to simply add the method in my script.So, to test this: filename: SPEAK/ITALIAN.pm
Now, in my script (in this case "test.pl") I simply want to add a method to the SPEAK::ITALIAN class with all constants and other good stuff in the correct namespaces and so onfilename: test.pl
Running this gives:
As you've noticed, GOODBYE is incorrect. It's not picking up the constant from the SPEAK::ITALIAN module.
I know I'm missing something very basic. Do I need "use base qw(SPEAK::ITALIAN)"?
Thanks in advance and apologies for the awfulness of the question...