in reply to crontab and @INC

You can use the lib pragma in your script to specify the path:

use lib '/var/www/html/bugztest/'; use someModuleInThatPath;
... or set your OS's PERL5LIB environment variable to include the directories you want Perl to search.

Hot Pastrami

Replies are listed 'Best First'.
Re: Re: crontab and @INC
by goblinfart (Initiate) on Feb 07, 2001 at 03:30 UTC
    Thanks for the tips! I ended up adding this: -I/var/www/html/bugztest/ to this: #!/usr/bonsaitools/bin/perl i.e. !/usr/bonsaitools/bin/perl -w -I/var/www/html/bugztest/ in the perl files that I wanted to run with crontab. A very cut and paste solution, not really sure exactly what its doing, but it worked! Thanks again, goblinfart

      What it's doing is adding /var/www/html/bugztest to the @INC directory, which tells Perl where to look for modules.

      As an aside: wrap your code in <code> and </code> tags, it makes it more readable!

      HTH

      Philosophy can be made out of anything. Or less -- Jerry A. Fodor