- Syntax Errors
Assume I have a script called test.cgi which requires the use of perl5.
I can run a test to see if the syntax of the script is correct
or not. Typing in:
perl -c test.cgi
will tell me if there is any obvious errors in my script
(I must be in same directory as test.cgi).
Is the version of perl that I am typing in the same version
that the script itself uses? Looking in my script, I notice that it
points to #!/usr/local/bin/perl.
returned a value of /usr/bin/perl. This meant that typing in
perl -c test.cgi would run an older version of perl
(in this case perl 4), and not the one I wanted. Typing in
perl -c test.cgi returns syntax errors. Of course --
it's using perl4 to debug the script. This script required perl5.
perl5 -c test.cgi
returned NO errors (in this case, perl5 had a symbolic link to