Class 31 review (07/24/2002)

  1. Very simple PERL/CGI application for volume calculations for cylinders. See the PERL script cyl.cgi CGI code.

  2. How can I run my PERL CGI program from the cowboy command line prompt, and simulate submitting some data to it from a form>
    venkman@spike:~/web/cgi-bin$ ./cyl.cgi radius=10 height=20 | more
    Content-type: text/html
    
    
    [HTML]
    [HEAD]
          [TITLE]Area of the cylinder via Perl script[/TITLE]
    [/HEAD]
    
    [BODY BGCOLOR=FFFF00]
    
    [CENTER][H1]Area of cylinder via Perl script cyl.cgi[/H1][/CENTER]
    
    [H3]For cylinder with radius 10 and height 20, the area is:
                                    [FONT COLOR=RED]6283.18[/FONT]  [/H3]
    [/BODY]
    [/HTML]
    
  3. Question ten from the study guide. Removing spaces and some punctuation characters.
    [jacobson@math-cs cgi-bin]$   cat q10.p
    # See question #10 in the study guide...
    
    $data = "UNI Panthers; oh ya, you go now! ";
    
    print "\n$data\n";
    
    $data =~ tr/ ,!;//d;
    
    print "\n$data\n\n";
    
    [jacobson@math-cs cgi-bin]$   perl q10.p
    
    UNI Panthers; oh ya, you go now!
    
    UNIPanthersohyayougonow
    
    [jacobson@math-cs cgi-bin]$