Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Everything works great except that only the first parameter in each group is actually written to the data files.
Any ideas?
Thanks! =)
--TWH
#!/usr/bin/perl -w use strict; use CGI; use DBI; use HTML::Template; #Open template file my $template = HTML::Template->new(filename => 'C:\Inetpub\wwwroot\cgi +-bin\input_accepted.tmpl'); my $cgi_query = new CGI; my @cgi_parameters = $cgi_query->param(); foreach my $returned_param (@cgi_parameters){ my $data = $cgi_query->param($returned_param); $returned_param =~ s/\d//g; #Strip digits from parameter so tha +t filenames match open(my $RESULTS_FILE, ">>C:/Inetpub/wwwroot/cgi-bin/results/$retu +rned_param.txt"); print $RESULTS_FILE $data . "\n"; close($RESULTS_FILE); } #Return meaningful output to user print "Content-Type: text/html\n\n", $template->output;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File rewrite question
by borisz (Canon) on Jan 09, 2004 at 19:22 UTC | |
|
Re: File rewrite question
by duff (Parson) on Jan 09, 2004 at 19:36 UTC | |
by Anonymous Monk on Jan 09, 2004 at 19:39 UTC | |
|
Re: File rewrite question
by kutsu (Priest) on Jan 10, 2004 at 05:06 UTC | |
|
Re: File rewrite question
by ysth (Canon) on Jan 11, 2004 at 22:27 UTC | |
|
Re: File rewrite question
by davido (Cardinal) on Jan 11, 2004 at 18:14 UTC |