dani681 has asked for the wisdom of the Perl Monks concerning the following question:

Currently I have delevoped a script on a perl version of 5.8.3, I am trying to give my friend the same script, but his server only has version 5.004.04 on it. Why is the script acting wierd. Also, how can I make the script work with his version. The script isn't really that fancy, the only other module I am using is CGI":Standard", and I believe that it is working correctly. Please help! Danielle

Replies are listed 'Best First'.
Re: version compatability
by davidrw (Prior) on May 06, 2005 at 00:16 UTC
    Can you provide more details of "acting weird" (and specific snippets if applicable)?

    What versions of CGI are on your server and your friend's server (I would guess they're different)? If different, check the CGI.pm changelog to see if anything in there matches up with your symptoms.
      I don't know what version of CGI is installed, but it's probably as old as the hills. But the only thing I'm using from that is the param() function, and that appears to be working. One example of the "weirdness" is my regular expressions. For example, the following line works perfectly on my server but doesn't work at all on my friend's: $strFile =~ s/ //g;
        Have you verified that the value of $strFile is exactly the same in both scripts when that line is executed? What is an example value? If it's not the same, how is $strFile set?

        Does the script have 'use warnings;' and 'use strict;'? If not, anything new when you add them?
        Update: ysth points out that 'use warnings' is a perl >= 5.6.0 thing. Hopefully 'use strict' will still help the OP to help us help him..
Re: version compatability
by Corion (Patriarch) on May 06, 2005 at 06:37 UTC

    I wish you luck. Perl 5.004 lacks many of the syntax stuff that is considered common nowadays. If you are not experienced with Perl, you have little chance of fixing it, but here are some stumbling blocks that I found:

    • No qr// syntax - use interpolated strings instead
    • No INIT blocks - copy and paste the code into your main program instead

    Your best bet is to either install a newer version of Perl or to find a better hosting provider that has a newer version of Perl.