penantes has asked for the wisdom of the Perl Monks concerning the following question:

Hi there
I had some problems of lacking modules on the production server where Im developing a "logwatcher", Advised by Fletch I used PAR by using my laptop as a linux workstation for development and packed what I needed after I was done.
The first line of the script contains the use package line:
use PAR 'getlogs.par';

But when I try to run it he goes searching for the package at @INC....
# perl get.pl
Can't locate PAR.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-so...etecetera

Im using perl v5.6.1 on Solaris 9.
Can someone hint me on this.
Generating a compiled executable its complicated for my because I would need a Solaris Sparc Server to do it which I haven't....
Thanks in advance.
Nuno A

Replies are listed 'Best First'.
Re: use question
by Zaxo (Archbishop) on Feb 21, 2005 at 18:05 UTC

    It's generally cleaner and more flexible to set up a private perl library and install any modules you need there. That also provides a place to put your own site modules outside the web document tree. I'm assuming that this is a web project on a shared server since you seem to have no cooperation from root.

    It's pretty easy to set up CPAN to install to your private perl library. I gave the details in Re: Personal library with CPAN. With that, you can set $PERL5LIB in your crontab and shell rcfile, as httpd environment, or use lib '/my/private/paradise'; to make perl find them.

    After Compline,
    Zaxo

Re: use question
by JediWizard (Deacon) on Feb 21, 2005 at 18:44 UTC

    If you want to build libraries yourself (without root access), you can still install them to non-standard directories (ie ones you can write to without root access). Download a tar ball from CPAN, and use the "LIB" and "PREFIX" command line parameters when running perl Makefile.PL to set the directory you would like files installed to by "make". See ExtUtils::MakeMaker

    perl Makefile.PL LIB=~/lib PREFIX=~/lib make make test make install
    May the Force be with you
Re: use question
by penantes (Acolyte) on Feb 21, 2005 at 17:59 UTC
    Yep!
    Im using:
    File::Tail (which implies Time::HiRes)
    NET::SMTP
    And Im going to need: SOAP::Lite
    Nobody said life is easy ;)
    Does my perl version supports my to point directly to a pm file?
    Regards,
    Nuno A
Re: use question
by chas (Priest) on Feb 21, 2005 at 18:41 UTC
    Setting up CPAN to to your own private installations as mentioned already is probably the best thing. You can also download and extract the source and invoke the makefiles with
    perl Makefile.PL LIB=some_directory PREFIX=some_directory

    (where some_directory is of your choosing, of course) (I've done this setting LIB and/or PREFIX, and sometimes it only worked well setting both.)
    chas
Re: use question
by penantes (Acolyte) on Feb 21, 2005 at 23:23 UTC
    Unfortunatly you're not correct, it is a core bussiness server which I can't describe more.
    Your comments (from all) are very helpfully and I appreciate them but they wont do the trick since the machine has no compiler.
    File::Tail is Time:HiRes dependant and this module needs a compiler.... :(
    Thats why the PAR idea sounded good....
    Can't someone tell why the  use PAR 'getlogs.par'; don't work?
    Thanks,
    Nuno A

      What part of 'Can't locate PAR.pm in ...' did you not understand? It's not installed so how can Perl use it?

      The machine has no compiler. The admins won't let you install anything. Looks like you have some homework to do; specifically, how to do what you need to do with pure perl modules.

Re: use question
by phaylon (Curate) on Feb 21, 2005 at 17:42 UTC
    update accidentally erased msg. Q was: why not install PAR?

    Ordinary morality is for ordinary people. -- Aleister Crowley
      I can't,
      The sys admins wont let me! :P
      Regards
      Nuno A
        That's bad, sure you need the PAR'ed application?

        Ordinary morality is for ordinary people. -- Aleister Crowley