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 reply to Re: Altering Package Subs and Running In To Problems by Aighearach
in thread Altering Package Subs and Running In To Problems by Bovine

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.