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 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 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" 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??