I. Study Guide: A. General Guideline: 1. Study the summary in each chapter. 2. Study the lecture notes. 3. Study those sample codes shown in the class. 4. Study the textbook. 5. Do the review questions and exercises. B. Review for the Test 1: 1. Understand the basic terminologies. 2. Understand HTML and know how to write a HTML document. 3. Understand the Perl and know how to write a Perl program. Know how to use regular expressions. 4. Understand using Perl for CGI programming and know how to write a CGI program. II. Sample Questions: A. Multiple Choice Questions: (b) 1. Which one is a Web browser? (a) Apache (b) Netscape Navigator (c) IIS (d) Tomcat (a) 2. Which one is a Web server? (a) Apache (b) Netscape Navigator (c) Mozilla (d) lynx (d) 3. The default port for the HTTP server is: (a) 22 (b) 25 (c) 79 (d) 80 (c) 4. Which one is not a request method defined by HTTP? (a) GET (b) HEAD (c) PASTE (d) DELETE (b) 5. Which one is not a HTML editor? (a) Macromedia Dreamweaver (b) IIS (c) Adobe PageMill (d) FrontPage (d) 6. Let an array be @list = (2, 3, 4). After the operation of push @list, (1, 2). @list will be: (a) (1, 3, 4) (b) (1, 2, 3, 4) (c) (1, 2, 3) (d) (2, 3, 4, 1, 2) B. Question & Answer: 1. Terminologies: (1) WWW (2) HTTP (3) HTML (4) MIME (5) URL 2. What are the three categories of Perl variables? Give an example for each case. Ans: Scalar variables: $name Arrary: @list Hash: %ages 3. Consider the following Perl code. Write the results after running this code. list = (10, 2, 7, 6, 9); $len = @list; print "$len \n"; print "$#list \n"; $first = shift @list; print "$first \n"; Ans: 5 4 10 4. Give an example for pass-by-value and pass-by-reference in Perl? Ans: my ($a, $b) = (2, 3); swop($a, $b); swap(\$a, \$b); sub swop { # Call-by-value my ($a, $b) = @_; $temp = $a; $a = $b; $b = $temp; } sub swap { # call-by-reference my ($c, $d) = @_; $temp = $$c; $$c = $$d; $$d = $temp; } 5. Write a HTML document to request a CGI program reply.pl in the cgi-bin directory of your account at kirk.cs.twsu.edu:6550. Ans: Assume the login name is cs655.