1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

Discussion in 'Meet and Greet' started by BigBobby, Apr 18, 2012.

  1. BigBobby

    BigBobby New Member

    Joined:
    Apr 18, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Need some help on this one. I have exhausted all avenues so I thought maybe someone here can help.
    I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning.
    The script is called cwrmail.pl and is located in my cgi-bin.
    When I run the script I get a 500 error. The script is called from a CGI Post form on another page. I have narrowed it down to the "read" statement...as follows:


    read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs)
    {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-FA-F0-9][a-FA-F0-9])/pack("C", hex($1))/eg;
    $contents{$name} = $value;
    }


    If I comment out this section and add a "print" function, it works and prints to the screen so I am positive this section is the problem. The "read" statement is correct. The chmod is 755 for both the script and the cgi-bin.I have tried uploading via FTP in both ASCII and binary to no avail. I have edited in both NotePad ++ and WordPad.
    The support at justhost is pretty good except they seem to be lacking Perl techs. I don't think this is a Perl issue but really not sure!
    Anyone have any other ideas??
    Thanks,
    Bob
     

Share This Page