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