Save I have a perl module (MyPerlPackage.pm) that is located 1 directory up
and down in the directory directoryname.

Here's how I would get to it:

use lib '../directoryname';
use MyPerlPackage;

-----Original Message-----
From: Sean Ahern [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 11:00 AM
To: [EMAIL PROTECTED]
Subject: RE: Perl Modularisation


At 16:25 03/05/2002 +0100, Aaron Trevena wrote:
>path/to/module/module.pm can be accessed as :
>use path::to::module::module;
>
>where the module starts :
>package path::to::module::module;

And as far as I know perl only finds this if it is in the perl search path 
@INC.  Which its not, because I dont want to set a global search path that 
includes each and every project.


>' use lib "dir/"; ' - this allows you to do:
>use lib "path/to/module/";
>use module;
>
>or
>
>use lib "path/to/";
>use module::module;
>
>assuming you declare the package in module to be module or module::module
>respectively

I think you missed where I said I dont want to have to use 'use lib' 
(because I believed it used absolute paths)

Ive had a suggestion that 'use lib' might be able to use relative paths, 
though.  I have to check that.

>as for:
>
>use module qw(foo bar);
>
>use exporter and put foo and bar into @EXPORT_OK
>
>this is explained in perldoc Exporter, and the documentation for modules.

I know that, and I already do this.  Hence I dont believe this has anything 
to do with my problem.  My problem -here- is that

use "module.pm" qw(foo bar)
and
use "../Modules/module.pm" qw(foo bar)

dont seem to be valid syntax.


>I'd reccomend the Camel Book ( aka O'Reilly - Programming Perl - Wall,
>Christiansan, Schwartz )
>
>It explains all this rather well.]

I have it in front of me.  It explains all of what you have said rather 
well, which is why my existing version of the program works perfectly 
well.  However Im afraid that none of what you have brought up appears to 
address what I actually  was asking.  It certainly doesnt cover the

use "module.pm" qw(foo bar)

case

I'll state it as clearly as I can:  I want to be able to 'use' or 'require' 
modules that are not in my search path in @INC, to be able to do so by 
means of relative filepaths, and without the necessity for 'use 
lib'  statements.
This is exacerbated by the fact that I cant find any documentation anywhere 
(camel Book, perlfaq, PerlMonks etc.) covering the case of attempting only 
to import a subset of the exportable subroutines of a module  when the 
module is accessed via a path supplied in the 'use "path/module" qw(sub) ' 
statement itself.

         Sean


-----------------------------------------------------------

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to