[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 496
  • Last Modified:

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
0
houndour
Asked:
houndour
  • 2
  • 2
1 Solution
 
gripeCommented:
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/

0
 
TintinCommented:
Perl 5.003 really is ancient, has security issues and has no updates.

However, if you can't update, you can try a really old version of CGI.pm.  You can download every available version of CGI (or any other module for that matter) from

http://search.cpan.org/~lds/CGI.pm-3.05/

Choose the appropriate version in the dropdown list.  The oldest CGI.pm version available on CPAN is 2.45

I would also caution you with picking up random free scripts.  Unless you know Perl well, it is hard to sort out the cruft from well written code, and believe you me, there is a ton of really badly written Perl/CGI code out there.

In general, if you want some quality written (and well supported and maintained) Perl/CGI scripts, then check out:

http://nms-cgi.sourceforge.net/

Unfortunately, they don't have an upload script, but if you ever need stuff like a guestbook, formmail etc, it's a great place to start.

Now, where did you get your upload script from?

If you don't have any luck with CGI.pm, you can always go down the cgi-lib.pl library, which pre-dates CGI.pm and was used extensively in the Perl 4 days and early Perl 5 days.
0
 
houndourAuthor Commented:
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
0
 
TintinCommented:
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.
0
 
houndourAuthor Commented:
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
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now