On Monday, Jul 28, 2003, at 04:12 US/Pacific, <[EMAIL PROTECTED]> wrote: [..]
So I moved my module to /usr/lib/perl/ and it work o.k.

not a recommended strategy, trust me.


you may want to start with reading

        perldoc h2xs
        perldoc perlmod

for a start on how to think about creating your
modules is a reasonably sane manner.

I would of course recommend that these are topics
well covered in chapters 12-15 of

        Learning Perl Objects, References & Modules
        Randal L. Schwartz with Tom Phoenix

since that way you can avoid the need to deal with
such things as 'use lib' - cf

perldoc lib

Recently I read somewhere that, instead of always moving  my modules to
/usr/lib/perl/, I could place them anywhere in my program directory and
indicate the location in my scripts e.g.
#!/usr/bin/perl -w
push(@INC, "MyLibDir");
require mymodule.pm;
###############################
But one thing that am not sure of is: Do I need "push(@INC,
"MyLibDir")";in all my scripts or is it enough only to indicate only
once?

if you build out your module to be a 'CPAN style Deliverable' then you do not have to worry, since it will be installed where ever the version of perl on the host happens to put those things in it's 'site_perl' section.

The alternative is that you will want to

use lib '/fully/qualified/path/to/your/stuff';

so that you KNOW that it will always be in the
correct place, one of the 'cheats' that one can
get away with in the cgi environment is that MOST
'reasonable' web-servers will 'chdir' to the directory
where the foo.cgi is invoked - so one can do the
relative path offset solution of

use lib '../lib';

and then hang your modules there...



ciao
drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to