chuleto1 has asked for the wisdom of the Perl Monks concerning the following question:
#file.pl #!/usr/bin/perl use strict; use CGI::Cookie; use CGI; my $cgi = new CGI; my $file = "/var/www/html/datfiles/data.dat"; print $cgi->header( -cookie => new CGI::Cookie(-name => 'Cho +colateChip', -value=> $cgi- +>param('color'), -expires => 'T +hu, 26-Sep-2002 00:00:00 GMT'#, #-domain => 's +tudents.byu.edu', #-path => '/' ) ); print $cgi->start_html(-title => 'Results', -bgcolor => $cgi->param('color')); if ($cgi->param()) { print $cgi->center( $cgi->h3("Hello: ". $cgi->param('name')), $cgi->p, "The keywords are: ",join(", ",$cgi->param('words')), $cgi->p, "Your favorite color is: ",$cgi->param('color')); } printing(); print $cgi->end_html(); sub printing { open(FILE, ">$file")|| die "Cannot save file $file "; print "test"; print FILE $cgi->param('name'); print FILE join(", ",$cgi->param('words')); print FILE $cgi->param('color'); close FILE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cannot save to file with a CGI scipt
by valdez (Monsignor) on Sep 23, 2002 at 15:38 UTC | |
|
Re: Cannot save to file with a CGI scipt
by kabel (Chaplain) on Sep 23, 2002 at 15:28 UTC | |
|
Re: Cannot save to file with a CGI scipt
by George_Sherston (Vicar) on Sep 23, 2002 at 21:42 UTC | |
|
Re: Cannot save to file with a CGI scipt
by hacker_j99 (Beadle) on Oct 23, 2002 at 08:33 UTC |