Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: seamlessly use an extended class's use'd libs

by jkahn (Friar)
on Sep 09, 2002 at 04:57 UTC ( #196163=note: print w/ replies, xml ) Need Help??


in reply to seamlessly use an extended class's use'd libs

Well, since the new class is its own package, you'll have to separately bring the Carp methods into that new class, by just adding the use Carp;
Though this may seem like a pain, it's actually a good idea, since one of the main points of subclassing in OO coding is so that the extender need not know how the base class is implemented.
If you really want to load all the packages that your base class has loaded, I suppose you could crawl the symbol tables yourself and load them all, but isn't it just easier to use the modules yourself? (Note: I've never done this, and it doesn't seem wise!)
Perhaps you're concerned that loading the modules (with use) again would cost speed -- belay that fear. use is just require with a more sophisticated redundancy check.


Comment on Re: seamlessly use an extended class's use'd libs
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://196163]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2014-09-21 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls