Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Perl Bug? import function

by wog (Curate)
on Sep 13, 2001 at 04:17 UTC ( [id://112073]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Perl Bug? import function
in thread Perl Bug? import function

Using the :: notation is not a "use hack" by itself. This is used, quite properly, to have modules be in catergories, e.g. XML::Parser, IO::Socket, etc.

What I was referring to was taking advantage of this notation to load a module based on its location, instead of based on its name. The way to do this task in a way which does not have cavaets is to modify @INC (e.g. using lib) so you can load the module in question using its real name. Even if this approach did work, I find it to be bad style -- a use line should tell you what module you are using, it should not be something that needs to be modified when you just move files around.

Replies are listed 'Best First'.
Re: Re: Re: Re: Perl Bug? import function
by jroberts (Acolyte) on Sep 13, 2001 at 04:28 UTC
    I've never looked at the code for XML::Parser for example, is the actual module (package) as follows..?
    package XML::Parser;
    I looked, it is! Thanks for the heads up. I never considered the separtion of file name space and module hierarchy as separate because i didn't know that the above was a valid package name. Thanks again jr

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found