in reply to (tye)Re: Symbols not importing/exporting correctly
in thread Symbols not importing/exporting correctly

Great, it works. Question: I was under the impression that by using something like csLogs::Error that while, yes, this specifies a specific namespace, that in use it simply helped specify which subdirectory the module should be found in from one of the @INC locations. Am I walking fine lines here?

I think my old assumption is that Perl knew that csLogs::Error was the same namespace as Error if Error was in the csLogs directory.

Replies are listed 'Best First'.
(tye)Re2: Symbols not importing/exporting correctly
by tye (Sage) on May 03, 2001 at 20:11 UTC

    use csLogs::Error qw(a b) expands to:

    BEGIN { require csLogs::Error; import csLogs::Error qw(a b); }
    which expands to:
    BEGIN { require "csLogs/Error.pm"; csLogs::Error->import( qw(a b) ); }
    and that last line eventually becomes something like one of these:
    Exporter::import( "csLogs::Error", qw(a b) ); UNIVERSAL::import( "csLogs::Error", qw(a b) );
    So "csLogs::Error" is used both to find the Error.pm file and to find import(). So you need to get it right. Unfortunately, there is really no enforcement that the file csLogs/Error.pm defines a csLogs::Error::import() or sets @csLogs::Error::ISA= qw(Exporter) and @csLogs::Error::EXPORT.

    It would be nice if UNIVERSAL::import() complained about such things so you might find Universally unimportant and overused useful (and important).

            - tye (but my friends call me "Tye")