Put the file handle where to print: =====
#!/usr/bin/perl -w use strict; # No need to decode, CGI makes it for you! use CGI; # no need to set if you don't modify them my $q = new CGI; open(OUT, "> dataform.html") or die "Can't open file: $!"; print OUT "Candidate: $q->param('candidate')\n"; print OUT "Position: $q->param('position')\n"; print OUT "Education: $q->param('education')\n\n"; close OUT; ===== Untested, use at your own risks:) Etienne "AMORE,JUAN (HP-Roseville,ex1)" wrote: > > Any takers on this one:) > > > Subject: The below CGI script creates my dataform.html but when I > > open it theres no contents;ie Candidate: $candidate etc > > > > Hello Everyone, > > Any hints on how to send data into this file "dataform.html file" to > > append and update its contents.. > > I'm trying to write code to capture the values from a URL address line and > > have them sent > > to a file to be entered and appended for me to view later. > > The below code is what I'm trying to debug,because I can't get these > > values "John,Technician & BSdegree" > > from the following URL string > > "candidate=John&position=Technician&education=BSdegree" > > to get added to the dataform.html file. > > This script creates the file "dataform.html file" but no values are > > contained... > > Any ideas,.... > > > > #!/usr/bin/perl -w > > > > use strict; > > sub url_decode { # capture the values from the URL command line > > my $text = shift(); > > $text =~ tr/\+/ /; # substitute the + for spaces > > $text =~ s/%([a-f0-9][a-f0-9])/chr( hex( $1 ) )/eg; # clean up URL > > string > > > > use CGI; > > > > # set my paramenters > > my $q = new CGI; > > my $candidate = $q->param('candidate'); > > my $position = $q->param('position'); > > my $education = $q->param('education'); > > > > # send the values from my URL command line to the dataform.html to be > > added and appended: > > > > open(OUT, "> dataform.html") or die "Can't open file: $!"; > > print "Candidate: $candidate\n"; > > print "Position: $position\n"; > > print "Education: $Education\n\n"; > > close OUT; > > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]