You can use lib to include other perl modules.  I'm currently using IIS5 on
Win2k, with PerlEx.  I've done similar things on Unix with Apache.  You may
need to tweek this a little depending upon your platfor.

Say your .cgi's are all located in, /cgi-bin/, and your modules are located
in /cgi-bin/mylib/, and you want to access, /cgi-bin/mylib/MyModule.pm.

Then in the top of your cgi, with all of your other use statements, put:
use lib 'mylib';
use MyModule;

The "use lib 'mylib';" adds the mylib directory to your @INC.

If we happen to have a cgi in a different branch of the directory structure,
we can still get to our library modules.  For example:  /cgi-bin/mylib/
contains all our modules; /other-cgis/ contains some separate cgis.  To get
to our modules from /other-cgis/ using lib:
use lib '../cgi-bin/mylib/';
use MyModule;

Hope this helps.
Good luck,
Ember

-----Original Message-----
From: Christopher Hahn [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 06, 2001 6:36 PM
To: 'Mauricio Lairet P.'; Perl Users Mailing List
Subject: RE: Install PM



Hello,

I have also dealt with providing my own
support, beyond what my ISP was giving me
to do my webiste with.

...and I used the -I command line option of Perl to
add to @INC.

This works in the #! line of a CGI script, as in:
#!/usr/bin/perl -I/web/king/chahn/cgi-bin/perl
use Astro::MoonPhase;  <---My ISP did not have this ready.

(I needed to use a SSI to stuff the phase of the moon
into a clock website)

Good luck,

Christopher

> -----Original Message-----
> From: Mauricio Lairet P. [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 06, 2001 3:01 PM
> To: Perl Users Mailing List
> Subject: Install PM
> 
> 
> Hi!
> 
> First of all I wanted to thak all who helped me with my 
> Questions about SQL
> and ODBC.
> 
> Now, Im thinking of using DBI module to work with databases 
> intead of using
> Win32::ODBC but my hosting provider has only the typical 
> extensions of Perl
> installed and they are not helping so much. So I wanted to 
> know if there is
> a way to tell a script that the PM file is in other directory 
> so it will not
> look for it in the standard Perl directory. I want ot know 
> this not only for
> the mentioned DBI module but also to use any module I'd like 
> to use without
> asking the hosting provider to install it for me.
> 
> I'd really appreciate if you could help me here.
> 
> Thank you so much!
> 
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
> 
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to