marybailey
Programmer
Okay. This code works. It changes my file and runs fine.
But (and its a BIG but) when I take the prints out it gives me a 500 error. I want to take this piece of code and use it without the prints.
Help!
Mrs B.
-------------------------------------------------------
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY BGCOLOR=#FFFFFF>\n";
print "<CENTER>\n";
$data_file="../text/joinlist.txt";
open(DAT, $data_file) || die("Could not open file!"
;
@raw_data=<DAT>;
close(DAT);
$i=0;
foreach $member (@raw_data)
{
chop($member);
($mactive,$mrealname,$memail,$mmonth1,$mday1,$mmonth2,$mday2,$mmonth3,$mday3,$mmonth4,$mday4,$mspec
ial,$mhow)=split(/\,/,$member);
if ($mactive == 5) {
$mactive = 1;}
$hold="$mactive,$mrealname,$memail,$mmonth1,$mday1,$mmonth2,$mday2,$mmonth3,$mday3,$mmonth4,$mday4,
$mspecial,$mhow";
$tempArr[$i] = $hold;
$i=$i+1;
}
open(DAT,">../text/joinlist.txt"
|| die("Could not open file!"
;
foreach $gal (@tempArr)
{
print DAT "$gal\n";
}
close(DAT);
print "</CENTER>\n";
print "</BODY></HTML>";
But (and its a BIG but) when I take the prints out it gives me a 500 error. I want to take this piece of code and use it without the prints.
Help!
Mrs B.
-------------------------------------------------------
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY BGCOLOR=#FFFFFF>\n";
print "<CENTER>\n";
$data_file="../text/joinlist.txt";
open(DAT, $data_file) || die("Could not open file!"
@raw_data=<DAT>;
close(DAT);
$i=0;
foreach $member (@raw_data)
{
chop($member);
($mactive,$mrealname,$memail,$mmonth1,$mday1,$mmonth2,$mday2,$mmonth3,$mday3,$mmonth4,$mday4,$mspec
ial,$mhow)=split(/\,/,$member);
if ($mactive == 5) {
$mactive = 1;}
$hold="$mactive,$mrealname,$memail,$mmonth1,$mday1,$mmonth2,$mday2,$mmonth3,$mday3,$mmonth4,$mday4,
$mspecial,$mhow";
$tempArr[$i] = $hold;
$i=$i+1;
}
open(DAT,">../text/joinlist.txt"
foreach $gal (@tempArr)
{
print DAT "$gal\n";
}
close(DAT);
print "</CENTER>\n";
print "</BODY></HTML>";