in reply to Perl @INC Error

In your shell, run: which perl

In your crontab, list the full path to your perl executable:

/full/path/to/my/perl script.pl

Replies are listed 'Best First'.
Re^2: Perl @INC Error (cron)
by zee3b (Novice) on Aug 15, 2013 at 15:22 UTC

    Hey thanks for the reply. I tried your method it worked, however now I get a compilation error. When I run the script in terminal using "perl script.pl" it runs fine and gives me the output, however now it's giving me a error "No data sets or points at /path/script.pl line 142"

        I fixed the problem. So when I was executing the script the /path/ it doesnt load the data files opened by the script because I didnt have the path included to the data files in the script since I assumed they were in the same directory. However, I think the shell script executes the files from a different directory, so I just added

        cd /pathofdirectory/ /pathofperl/perl /pathofscript/script.pl
        and it worked. Thanks a lot though!

        Ok, I figured out the problem and it's really weird. When I go into the directory using "cd" and execute the script from there "perl script.pl" it works. I just tried it on windows too. But whenever I try "perl /path/script.pl" it gives me that data set error.