Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Meet and Greet (http://www.go4expert.com/community/meet-and-greet/)
-   -   Problem with Perl script after moving from a Windows/Apache Server to a UNIX server. (http://www.go4expert.com/community/perl-script-moving-windows-apache-t28221/)

BigBobby 18Apr2012 21:36

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.
 
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


All times are GMT +5.5. The time now is 23:12.