in reply to Re^2: Every Perl Script Is Failing Compilation
in thread Every Perl Script Is Failing Compilation

I am wondering how you are getting along with this problem.

You seem to have a LOT of stuff in the @INC path. Probably not an issue, but sometimes multiple versions can be trouble. I was not able to see immedidate problem with your command line stuff although there may be some file permission problems.

I can replicate your first error message in the following code. As I mentioned before, "use vars(....);" appears in File::Spec. When vars.pm can't be found or "used" $VERSION doesn't have package scope.

Anyway, start with simple code and then work from there. You have NO chance until you get this small program working:

#!/usr/bin/perl -w use strict; use File::Spec; use vars qw(@ISA $VERSION); $VERSION = '3.2501'; print "Im ok if no warnings"; __END_ If I comment out: use vars qw(@ISA $VERSION); I get your error mesage: Global symbol "$VERSION" requires explicit package name at C:\TEMP\simple.pl line 8.
At this point, I don't know how to help further. I can replicate your first error code in just a few lines of test code. Get stuff working from command line with you as the user. Then working from that, work on how to get Apache CGI server able to do the same thing.

You may find this of help: http://perl.apache.org/docs/general/perl_reference/perl_reference.html#The__INC_array as well as Unix file permission (google on chmod).

Replies are listed 'Best First'.
Re^4: Every Perl Script Is Failing Compilation
by Anonymous Monk on Sep 10, 2009 at 08:59 UTC

    Hi there,

    The print out from the original test script you gave me is the output when I run it. I installed perl 5.10, and this gives me the same output, just with the single version for perl for the @INC paths (I installed it in a different location).

    The new installation has fixed all my problems for perl, as long as it is run from the new location (needing all the new modules etc). So when I run the simple code above, I get the same results as you. If I run it with the old version, I get the same error message as the second one from my original post, regardless of whether I have commented out the 'use vars qw(@ISA $VERSION)' line, so it is this line that is causing all the problems. I've had a look at all the file permissions from the @INC paths and they all seem ok. I've looked in all the paths that are thrown up in the error message, is there anywhere else I need to look, specifically for $VERSION? Carp.pm, File, File/Spec, and all the packages in these folders all have the correct permissions (-rw-r--r-- for .pm files, and drwxr-xr-x for folders, I'm assuming that these are all correct?)

    Thanks for your help

      Sounds like a directory/permission problem. Compare what works vs what doesn't work.

      The new installation has fixed all my problems for perl. That statement speaks volumes.

Re^4: Every Perl Script Is Failing Compilation
by Anonymous Monk on Sep 11, 2009 at 14:10 UTC

    I resulted to reinstalling perl 5.8, which has fixed all the problems. Seems one of the binaries got corrupted at some point, but it is all now working.

    Thanks for all your help