Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re (5): exporter and multiple namespaces

by btrott (Parson)
on May 01, 2001 at 23:45 UTC ( [id://77093]=note: print w/replies, xml ) Need Help??


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 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 :)

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://77093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2024-03-28 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found