
Delux
New User
Feb 18, 2007, 1:19 PM
Post #1 of 2
(5620 views)
|
new to perl need some help please
|
Can't Post
|
|
Hey, I am taking a class in perl, and my assignement was to make this form so i have the form all made and it works, now i have to take this form and have the data that is entered saved to a text file. how would i go about doing this. here is my perl file.
#!C:/Perl/bin/perl.exe #juniper.cgi - creates a dynamic Web page that acknowledges #the receipt of a registration form print "Content-type: text/html\n\n"; use CGI qw(:standard); use strict; #declare variables (** change $ to @ in sysletter / add $key **) my ($name, $serial, $modnum, @sysletter, $key); my @models = ("Laser JX", "Laser PL", "ColorPrint XL"); # add hash declaration my %systems = ("W", "Windows", "M", "Macintosh", "L", "Linux"); #assign input items to variables $name = param('Name'); $serial = param('Serial'); $modnum = param('Model'); # (** change $ to @ in sysletter) @sysletter = param('System'); #create Web page print "<html><head><title>Juniper Printers</title></head>\n"; print "<BODY><H2>\n"; print "Thank you, $name, for completing \n"; print "the registration form.<br /><br />\n"; print "We have registered your Juniper $models[$modnum] printer, \n"; print "serial number, $serial. \n"; # (** modify hash references for multiple selections **) print "You indicated that the printer will be used on the \n"; print "following systems: <br /> \n"; foreach $key (@sysletter) { print "$systems{$key} <br />\n"; } print "</h2></body></html>\n"; if you need me to post my form file i can do that as well. thanks
|