Hi folks,
Perl is always killing me. I always do it on my computer first and then upload to the server in our lab. And oh my, never ever be correct to run on the lab. This time I got the internal error. I tried to add and delete multiple lines and found out that is possibly due to tie::File.
Could you please help me to solve the problem? I am dying for it :(
Here's the code.
[code=perl]
#!/usr/bin/perl
#use CGI::Carp qw(fatalsToBrow ser);
#use strict;
use CGI;
use Tie::File;
$query = new CGI;
$data_file="nam eList.cgi";
open(DAT, $data_file) || die("Could not open file!");
@raw_data=<DAT> ;
tie @line, 'Tie::File', $data_file or die("Could not open file!");
print $query->header();
print "Content-type: text/html\n\n";
print "<HTML><HEAD>\n ";
print "<TITLE>Thanks! </TITLE></HEAD>\n";
print "<BODY>";
$first = $query->param("first") ;
$last = $query->param("last" );
$email = $query->param("email") ;
print "<P>$first $last, thank you for signing up! Please click <a href=\"list.pl\ ">here</a> to see the signup table for confirmation and don't repeatly signing up.</P>\n";
$count = 0;
@WS = $query->param("ws");
foreach $ws(@WS){
$line[$ws-1].="$first $last, $email|";
}
close(DAT);
print "</BODY>\n";
print "</HTML>\n";
[/code]
-------------------------------------------------------------------------------------------------------
And I've tried use warnings, add and remove -w.....doesn't work.........cr ying T-T
Cannot appreciate more.
Perl is always killing me. I always do it on my computer first and then upload to the server in our lab. And oh my, never ever be correct to run on the lab. This time I got the internal error. I tried to add and delete multiple lines and found out that is possibly due to tie::File.
Could you please help me to solve the problem? I am dying for it :(
Here's the code.
[code=perl]
#!/usr/bin/perl
#use CGI::Carp qw(fatalsToBrow ser);
#use strict;
use CGI;
use Tie::File;
$query = new CGI;
$data_file="nam eList.cgi";
open(DAT, $data_file) || die("Could not open file!");
@raw_data=<DAT> ;
tie @line, 'Tie::File', $data_file or die("Could not open file!");
print $query->header();
print "Content-type: text/html\n\n";
print "<HTML><HEAD>\n ";
print "<TITLE>Thanks! </TITLE></HEAD>\n";
print "<BODY>";
$first = $query->param("first") ;
$last = $query->param("last" );
$email = $query->param("email") ;
print "<P>$first $last, thank you for signing up! Please click <a href=\"list.pl\ ">here</a> to see the signup table for confirmation and don't repeatly signing up.</P>\n";
$count = 0;
@WS = $query->param("ws");
foreach $ws(@WS){
$line[$ws-1].="$first $last, $email|";
}
close(DAT);
print "</BODY>\n";
print "</HTML>\n";
[/code]
-------------------------------------------------------------------------------------------------------
And I've tried use warnings, add and remove -w.....doesn't work.........cr ying T-T
Cannot appreciate more.
Comment