I have a module, let's call it "SpiderMan". SpiderMan defines a function that contains a function from another module. Let's call this other module "Doctor Octopus".

So of course, SpiderMan will not compile unless it gets that function from Doctor Octopus. (Hey, at least, I didn't use Mister Ed and the characters from Gilligan's Island for module names, okay?).

Now the problem is that Doctor Octopus also calls many functions from SpiderMan. Doctor Octopus must use the SpiderMan module. So both modules need functions from each other.

So I am seeing an error: "Undefined subroutine..." coming from Doctor Octopus. This subroutine is from SpiderMan. I know that SpiderMan is exporting this function. So what's going on? (Note that the function in question is not the one containing the Doctor Octopus function.)

When I do 'perl -cw' on SpiderMan and Doctor Octopus, I get all these "subroutine redefined" warnings... I have a hunch about what's going wrong. But I am unsure how to solve it. Thanks for any insight.


In reply to Undefined subroutine errors by Anonymous Monk

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.