We don't bite newbies here... much | |
PerlMonks |
Re: Altering Package Subs and Running In To Problemsby Aighearach (Initiate) |
on Nov 11, 2004 at 03:17 UTC ( [id://406895]=note: print w/replies, xml ) | Need Help?? |
The problem is, you are standing there with a bunch of bricks trying to build a grass hut.
Figure out first what you're trying to do, THEN decide how to do it. Which is to say, your implementation is wrong. You're trying to change the way SomeModule behaves, but you're only the user of that module. Normally this is better changed by subclassing SomeModule. Because then you're not trying to be more than a user of SomeModule. Because, you're only a user. To do it the way you are wanting to, you'll need a real pragma and not just a regular module. If that doesn't tell you what you have to do differently, you're not ready. Sorry if that sounds dismissive. But, bone up on internals and then you will be in a better place for this. If the module you're trying to change is arbitrary, then it's harder. But if you're trying to change a SPECIFIC module, then you could also just make sure you've loaded it already in your module, and then as long as your module gets loaded first, use OtherModule will be redundant and ignored and not a problem. But that's very brittle, and not a good idea. THough I'm not sure what you're trying to do in the first place is a Good Idea -- Snazzy tagline here
In Section
Seekers of Perl Wisdom
|
|