LATER: ahh, it seems the .pm name and the package name have to be the same! Does that mean I have to put multiple packages in seperate modules??!?

No, and no. But: use does a lookup per file name. Inside a file, the package statement declares a name space. It is highly confusing if the file name and the name space name are not related, or chosen nilly-willy.

Remember that use Foo is (roughly) equivalent to

if (eval "require $package") { $package->import(@args); }

If your file is called mine.pm and you use that (use mine;), but inside that file there's a name space mypack established, the use attempts to call mine->import and not mypack->import. There is no facility in Exporter to check which name spaces have been set up by an imported file which wishes to export symbols.

As for your second question - you may set up multiple name spaces in one file, but only the name space which matches the file name will be handled correctly with Exporter.


In reply to Re: how to export methods from module [only partially SOLVED] by shmem
in thread how to export methods from module [only partially SOLVED] by halfcountplus

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.