Problem with Perl script?

I keep getting this error but when I tested it and developed in in Windows NT using IIS4 and Active Perl 5.0 it worked great.  Now i uploaded it to earthlink that host the domain site and I had them turn on the perl script and I keep getting the following error:
HTTP 500 Internal Server error
 The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

Can anyone see what could be causing this?

Thanks

/** registration.htm file

      <FORM ACTION="http://www.interactdatabase.com/sem_registration/reg.pl" METHOD="POST" NAME="frmRegistration" OnSubmit="return validation()">



/** reg.pl file below

#!/usr/local/bin/perl
use CGI;

$query = new CGI;

open( FILEIO, ">>reg.txt" ) or
      die( "Cannot open reg.txt file" );

$delm = ",";
$qt = "'";
$fname             = $query->param('firstName');
$lname             = $query->param('lastName');
$title            = $query->param('title');
$badge            = $query->param('badge');
$company      = $query->param('company');
$address      = $query->param('address');
$city            = $query->param('city');
$state            = $query->param('state');
$country      = $query->param('country');
$zip            = $query->param('zip');
$email            = $query->param('email');
$phone            = $query->param('phone');
$fax            = $query->param('fax');
$NovEvent      = $query->param('nov_date');
$DecEvent      = $query->param('dec_date');
$cust            = $query->param('cus_sel');
$sales            = $query->param('sales_sel');
$call            = $query->param('call_sel');
$fin            = $query->param('fin_sel');
$buss            = $query->param('buss_sel');
$supp            = $query->param('sup_sel');
$entr            = $query->param('entr_sel');
$hear            = $query->param('hearSem');
$hear_other      = $query->param('hearSem_Other');
$rep            = $query->param('rep_name');

$fromEmail     = "eric@earthlink.net";
$emailSubject = "Tesitng";
$emailMessage = "Thank you for respondeing\n To use";

if( !$badge )
{
      $badge = $lname . "," . $fname;
}

$event = "";

if( $NovEvent && $DecEvent)
{
      $event = "Nov" . "," . "Dec";
}
elsif( $NovEvent && !$DecEvent )
{
      $event = "Nov";
}
elsif( $DecEvent && !$NovEvent )
{
      $event = "Dec";
}

if( $cust )
{
      $cust = "Customer Relationship Management = yes";
}
else
{
      $cust = "Customer Relationship Management = no";
}

if( $sales )
{
      $sales = "Sales/Marketing = yes";
}
else
{
      $sales = "Sales/Marketing = no";
}

if( $call )
{
      $call = "Call Center = yes";
}
else
{
      $call = "Call Center = no";
}

if( $fin )
{
      $fin = "Financials = yes";
}
else
{
      $fin = "Financials = no";
}

if( $buss )
{
      $buss = "Business Intelligience = yes";
}
else
{
      $buss = "Business Intelligience = no";
}

if( $supp )
{
      $supp = "Customer Service And Support = yes";
}
else
{
      $supp = "Customer Service And Support = no";
}

if( $entr )
{
      $entr = "Enterprise Resource Planning = yes";
}
else
{
      $entr = "Enterprise Resource Planning = no";
}


if( $hear == 0 )
{
      $hear = "Direct Mail";
}
elsif( $hear == 1 )
{
      $hear = "Telemarketing";
}
elsif( $hear == 2 )
{
      $hear = "Web Site";
}
elsif( $hear == 3 )
{
      $hear = "Other: " . $hear_other;
}


print FILEIO "'", $fname, "'", ",",
             "'", $lname, "'", ",",
             "'", $title, "'", ",",
             "'", $badge, "'", ",",
             "'", $company, "'", ",",
             "'", $address, "'", ",",
             "'", $city, "'", ",",
             "'", $state, "'", ",",
             "'", $country, "'", ",",
             "'", $zip, "'", ",",
             "'", $email, "'", ",",
             "'", $phone, "'", ",",
             "'", $fax, "'", ",",
             "'", $event, "'", ",",
             "'", $cust, "'", ",",
             "'", $sales, "'", ",",
             "'", $call, "'", ",",
             "'", $fin, "'", ",",
             "'", $buss, "'", ",",
             "'", $supp, "'", ",",
             "'", $entr, "'", ",",
             "'", $hear, "'", ",",
             "'", $rep, "'", "\n";
                        

close( FILEIO );


print <<'EOT';
Location: http://www.interactdatabase.com/

EOT
eric07Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
What error are you getting in the server error log?
Did it complain about writing "@earthlink" as "\@earthlink" in
$fromEmail     = "eric@earthlink.net"; ?
do you die( "Cannot open reg.txt file" )?
is EOT the only thing on the line with no extra blanks around it?
0
ralpCommented:
A couple of things.

The double quotes around your email address "eric@erathlink.net" will allow perl to try to use @earthlink as an array, this is now a compile bug. Try using single quotes or escaping the @ sign as "eric\@erathlink.net".

Also a run time error could be that it can't write the reg.txt due to permission problems.

For CGI scripts it's best to add some debugging to the script.
such as before you really do anything, redirect STDERR to STDOUT such as

open(STDERR, ">&STDOUT");

$query = new CGI;
print $query->headers, $query->start_html;

and then all your error messages will come out in the browswer  so when you do have a run time error you'll see when and where it is... This way you won't need access to the web server's error_log.
0
ramvinodCommented:
location of perl maynot be /usr/local/bin.

i just tried it, if you dont specify path to perl properly it gives 500 Internal Server Error. if it isnt able to write to a file, it doesn't complain at all. (it == perl script.)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.