Hey Guys,
Is it possible to write to 2 seperate text files from the same CGI script? I'm trying and cannot get the second "write" to work. Any suggestions?
my $temp = param('temp');
my $post = param('post');
if($temp eq "")
{
print "Temp has no value";
}
else
{
#print temp results first
open(OUT, ">../retirement_notes/denomyTemp.txt") or die "Cannot write to file.";
print OUT "$temp\n";
close(OUT);
print "Temp posts have been saved successfully<br /><br />";
}
if($post eq "")
{
print "post has no value";
}
else
{
#now print post results
print $post."<br /><br />";
open(spitOut, ">>../retirement_notes/denomyPosts.txt") or die "Cannot write to file.";
print spitOut "$post\n";
close(spitOut);
print "Approved posts have been saved successfully<br /><br />";
}
Is it possible to write to 2 seperate text files from the same CGI script? I'm trying and cannot get the second "write" to work. Any suggestions?
my $temp = param('temp');
my $post = param('post');
if($temp eq "")
{
print "Temp has no value";
}
else
{
#print temp results first
open(OUT, ">../retirement_notes/denomyTemp.txt") or die "Cannot write to file.";
print OUT "$temp\n";
close(OUT);
print "Temp posts have been saved successfully<br /><br />";
}
if($post eq "")
{
print "post has no value";
}
else
{
#now print post results
print $post."<br /><br />";
open(spitOut, ">>../retirement_notes/denomyPosts.txt") or die "Cannot write to file.";
print spitOut "$post\n";
close(spitOut);
print "Approved posts have been saved successfully<br /><br />";
}