This is kind of a follow up to this question, which i posted earlier I have been running into this not so uncommon error:

Undefined subroutine &csDB::csErrorClass called at f:/projects/site/bin/lib//csDB.pm line 55

which is a no brainer because of course csErrorClass is in my csLogs::Error.pm module, which I then 'use' in csDB.pm.

perl -w -McsDB -e 1; runs without a hitch, so the problem seems to be when the csDB module is used from other scripts which also use the Error.pm module.

From the last thread (linked above) it sounds like the Exporter module's import routine simply aliases the EXPORT'ed variables/subs etc into the current namespace, but does it do this each time the module is included? If I have 3 module files and a script all of which reference a 4th module file, will all of the normally exported symbols from that module be exported into all four of the other namespaces, or just whichever of them gets to say "use Module4" first?

The application behind this question is a core module that redirects some of perl's error handling to a form more useful for me (both by setting SIG handlers for warn and die, and by providing some replacements for warn and die as used in "or die" statements by programmers). As such, i need to have access to the functions in this module from just about every other file in my set of scripts & modules.


In reply to exporter and multiple namespaces by AidanLee

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.