in reply to Re (5): exporter and multiple namespaces
in thread exporter and multiple namespaces

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

Replies are listed 'Best First'.
(tye)Re: exporter and multiple namespaces
by tye (Sage) on May 02, 2001 at 01:22 UTC

    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.