Link to home
Start Free TrialLog in
Avatar of houndour
houndour

asked on

Perl 5.003 and CGI.pm

Hi,

I have what seems to be a client on a very old host.  I want to be able to upload files to the server.

I can't use ASP as all the scripts I managed to find won't work with the version of VBScript I have available.

I'm now moving onto CGI.  I downloaded a 'simple' upload script for free and tried running it.  First I got an error which I interpreted to mean I didn't have cgi.pm installed.  I contacted the host and they said it "should be there".

I downloaded cgi.pm from the only website I could find to download it from and put it in the cgi-bin along with all the other files that came with it.  After running the script I now get a similar message:

Can't locate constant.pm in @INC at CGI.pm line 32. BEGIN failed--compilation aborted at CGI.pm line 33. BEGIN failed--compilation aborted at /web/server/address/cgi-bin/upload.cgi line 159.

Only this time it's constant.pm it can't find.

I ran makefile.pl for the fun of it (came with cgi.pm download)  and I get this error:

Perl 5.004 required--this is only version 5.003, stopped at /web/server/address/cgi-bin/Makefile.PL line 2.

So, I have now deduced that I have version 5.003 of Perl.  So can I get a version of cgi.pm that works for this?  And where?  I've searched on Google for "download cgi.pm" and most of the websites are so out of date the links don't work.

While I'm here, is there a way of uploading scripts without using the cgi.pm module?

Thanks,

Sam
Avatar of gripe
gripe

The answer to this is that you should have your client update Perl. Newer versions of Perl come with an up to date CGI module that includes file upload capabilities. The 5.003 Perl version your client is running is _8 years_ old and shouldn't be used. It's very unlikely that you'll find a copy of the CGI module that is both compatible with version 5.003 and does what you want.

You can install a fresh copy of Perl and leave the old copy intact if you're concerned about breaking stuff on the server. I assume that you have shell access if you can execute the Makefile.PL for CGI.pm. You should install a new copy of Perl instead.

Is this a windows or UNIX host? You mention VBScript. If it's a windows machine, you can get the newest perl from http://www.activestate.com/ otherwise if it's a UNIX machine, there may be a binary package available for your particular flavour or you can get the source at http://perl.org/

ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of houndour

ASKER

Hi,

I have emailed the host again, asking them if they can upgrade Perl to 5.004.  And have also asked them what version of cgi.pm they have.

I don't have shell access, i ran it from IE :s.

Here are the server details:
OS : Solaris v2.6

Webserver : Stronghold Apache v1.2.6

Languages supported : Chillisoft ASP v3.0.04.782, Frontpage 97 & 98 Extensions, Perl v4, v5

Database supported : MySQL 3.22

The upload script came from http://www.perlscriptsjavascripts.com its called uploadLite.

If the host refuse to upgrade Perl, should I use the cgi-lib.pl?  I might look into this now.  I'll post again when I get a reply from the host.

Thanks,
Sam
An upgrade to Perl 5.004 is hardly worth it, as that is a very old version as well.  The latest version of Perl is 5.8.5

Looking at all the other versions you mentioned, I would be very worried as everything else is ancient as well.

Apache 1.2.6 has security holes.

When you are referring to the 'host', is this a service provider?  If so, I'd run a mile from them.  They obviously don't know/care about maintaining their systems.
Tintin, I totally agree.  The original spec for the job was for it to be done in PHP and MySQL which is where my experience lies.  Then I was told I had to work with ASP because thats what the client had.  It's been a nightmare since the start.  I could have finished this job in a week if it'd been PHP.  I've told my bosses that the hosting company (service provider) is crap and can we change it...the client won't change. I will put forward some more arguments for them to change service providers.

Thanks for your help, I tried the cgi-lib.pl, and it works.  I guess I'll have to go with that.

Sam