in reply to Re: Perl @INC Error (cron)
in thread Perl @INC Error

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"

Replies are listed 'Best First'.
Re^3: Perl @INC Error (cron)
by toolic (Bishop) on Aug 15, 2013 at 15:28 UTC

      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.

        The script probably expects the data file in the directory from which it was started. If you start it from a different one, it cannot find the data.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ