in reply to Re: Re: Re: Re: exporter and multiple namespaces
in thread exporter and multiple namespaces

Your original error message was that the function csErrorClass couldn't be found in the csDB package. And that makes sense from the above code, because that function is not defined anywhere, nor is it exported from csLogs::Error. Could that be your problem?

Do you define this function in csLogs::Error, and if so, why are you not exporting it?

@EXPORT = qw( csWarn csDie csErrorClass );

Replies are listed 'Best First'.
Re: Re (5): exporter and multiple namespaces
by AidanLee (Chaplain) on May 02, 2001 at 00:30 UTC

    here's an oddity. I fixed it so csErrorClass now resides in Error.pm. I am still getting this

    Undefined subroutine &csDB::csErrorClass called ...

    however i added this in csDB as a check right before the error occurs

    foreach ( sort keys %csDB::) { print $_."\n"; }

    so that i could see the symbols in the namespace. lo and behold:

    BEGIN END EXPORT EXPORT_FAIL EXPORT_OK GetLongLen ISA QueryDB SafeQuote SetLongLen VERSION csDBAuth csDie csErrorClass <----- there it is csErrorScale csPath dbh import

    leaving me generally confused

      That can happen if you never bother to define a csErrorClass routine inside of the module. Exporter will happily export non-existant functions making entries in your symbol table that point to non-existant functions.

              - tye (but my friends call me "Tye")
        That's true. And it's easy to create spurious typeglobs even without Exporter's help, so looking at the keys of the %csDB:: symbol table doesn't tell all. The proper way to tell if a function is defined is with defined(&some_func).
        and if it IS defined? It's an interesting fact I'll keep in mind, but unfortunately does not seem to be the case.
Re: Re (5): exporter and multiple namespaces
by AidanLee (Chaplain) on May 01, 2001 at 23:48 UTC

    thank you much. it had originally been in the Error.pm file, but i had moved it elsewhere and had forgotten to clean up my tracks.

    and for a moment there I thought I had an interesting problem :)