The links including class #36 and class #35 are great resources too.
Download the Movies Database by right-clicking on this link and choosing from popup-menu. Download the movies database in the lab directly to your Z: drive.
Your CGI program will have a SUBMIT button, and two TEXTBOXES, and suitable labels and heading and so on so the user enjoys the user interface provided, and knows how to use it and what it can do. Example: Month(s) 2,4,8-11 Year The output would be the February, April, and the August, September, October and November months for the current year, whatever the current year happens to be: Your CGI program should work as well in 2008 as it does in 2005! Example: Month(s) Year 2006 Your output would be all 12 months of whatever year the user asks for, but it will be just as the Unix cal 2006 command would output it. Example: Month(s) Year Your output would be just the current month's calendar. cal on Unix or Linux with no arguments gives you this months calendar. cal 4 2005 cal <------ Same output until 5/1/2005 gets here
venkman@bebop:~/web/cgi-bin$ 000calNotepad.cgi : bad interpreter: No such file or directory venkman@bebop:~/web/cgi-bin$ venkman@bebop:~/web/cgi-bin$ 000calAfterPico.cgi : bad interpreter: No such file or directory <--------- MYSTERY pico 000calAfterPico.cgi <----- open UNIX editor, make any 000calAfterPico.cgi one change, save changes, and NOTEPAD windows format ...works now... chars are GONE. venkman@bebop:~/web/cgi-bin$ 000calAfterPico.cgi <---- FILE converted Content-Type: text/html; charset=ISO-8859-1 and extra hidden windows chars snipped edit (scissors) removed, as it April 2005 was converted Su Mo Tu We Th Fr Sa to UNIX (Linux) 1 2 3 4 5 6 7 8 9 student.cns.uni.edu server is UNIX (Linux), 10 11 12 13 14 15 16 not windows... 17 18 19 20 21 22 23 24 25 26 27 28 29 30 venkman@bebop:~/web/cgi-bin$
$str = "UNI,Panthers;ISU,Cyclones;Iowa,Hawkeyes;USC,Trojans;" . "Idaho,Vandals;Pepperdine,Waves"; @schools = split(/;/, $str); foreach (@schools) { ($schoolName, $mascot) = split(/,/, $_); $schoolHash{ $schoolName } = $mascot; # $schoolName is the key } --- perl hashSchools.p Mascot for Pepperdine is Waves UNI is Panthers Iowa is Hawkeyes ISU is Cyclones Idaho is Vandals USC is Trojans
Vertical printing CGI program, including a PERL script to show you the PERL code.
Example two: Vertical printing CGI program, that does alot more.
PERL FAQ page especially for UNI and cowboy.cns.uni.edu environment.
Study these week 2 resources and and examples. They will help a great deal for the children's book new name game software and CGI application you are creating.
---------------------------------- Splitting a Value into Pieces page 185. ---------------------------------- JOIN is the opposite of SPLIT. open (FILE, "letter4Before.txt"); Practical $letter4Data = ""; Extraction and while () { Report chomp $_; $_ =~ tr/ >//d; Language @pair = split /=/, $_; $newPair = join (",", @pair); $letter4Data .= $newPair . ";"; } chop $letter4Data; close FILE; open (OUTFILE, ">letter4.txt"); print OUTFILE "$letter4Data"; close OUTFILE;
Review of class #2, along with suggested readings from textbook.
Snowball sentences, chomp, reading input files, etc. Second PERL web page from summer of 2002.
Random quotes, version #3. This one allows hypenated lists. 1,2-5,8,12 would display quotes 1, 2, 3, 4, 5, 8 and 12, for example.