810:088 PERL/CGI Web Programming
1st 4 weeks
- 2nd half, 2nd 4 weeks c088.html PERL/CGI class
- Quiz #3 cheat sheet, coin flip and
ASSIGNMENT #3 (random quotes, without any RECENT
repeats, modelled after the color.cgi program techniques.
Due Thursday, July 12th.
- Try out the colors.cgi script.
- See the colors.cgi Perl code,
to study the techniques such as hidden fields, arrays, split,
join, srand, rand and -TEXT parameter for the start_html CGI
- Try out version 2 colorsv2.cgi
script. It prints out a numbered (ordered list OL)
list of the previous BGCOLOR and TEXT color pairs.
- Look at the colorsv2.cgi Perl
script. Note the use of a Subroutine, as explained in
chapter 13 of the Elizabeth Castro text and in Hour 8 (Functions)
of Greg Perry book.
- Using Hidden Fields on HTML FORMs.
We'll use this to make the random.cgi example program far less likely
to repeat itself and show the user a quote they just saw a couple
clicks or RELOADs or REFRESHes ago.
- CGI.pm module functions
PowerPoint slide show. Covers these functions: header, start_html, h1,
start_form, br, hr, end_form, submit, textfield, password_field, reset,
popup_menu, radio_group, checkbox_group, params and end_html.
- Printing out all the param received
values, including which one of three SUBMIT buttons was clicked,
when the CGI script generated web page FORM data was submitted to
a 2nd CGI Perl script.
See the PERL code for the FORM
generating script and see code for
Perl script it submits data to.
- Prime number generating Perl/CGI
program. The primes.cgi PERL
script uses a combination of CGI functions and HTML tags.
- Back tic symbol by
the tilde on your keyboard and how to run an operating system
command from within Perl statements and placing the output in
the client's web page. Note: back tic was used to get the
calender by using Unix cal command in the Prime number program,
Monday, June 25th PERL code (j25.cgi) with
some annotations added. How to generate a web page using PERL without
having to know HTML. This will be covered during lecture on Tuesday.
- Try it out.
- See the HTML and Perl CGI functions
side by side, courtesy of Photoshop. The Perl CGI functions are in the
You will need to use the user id (your ACAD UNI USER ID) and password
that I passed out to take
810:088 ONLINE Quiz #1. After you
finish taking the quiz, you will receive a Carbon Copy of the email
message that I receive reporting your score and the way you answered
the questions. There are six questions. You may take the quiz more
than once, if you wish. Let me know if you lost or forgot your user
id and password, and can't get to the quiz page. Your User ID is the
one with 6 letters of your last name, your 1st initial, and FOUR
Quiz Thursday June 21st:
Quiz #1 study guide,
with additional notes about the Interest Calculator assignment, and what
to turn in as printout and what to mail email@example.com as URL.
First assignment: PERL/CGI
Interest Calculator, adapted from the Greg Perry Perl textbook.
Here is the working
Cylinder Area Calculator from
the Friday, June 15th hands-on lab class. Study it to develop
the understanding and technique needed for the Interest Calculator.
Posted Monday, June 18th in the evening: Menus in
HTML FORMs and RGB color triplets example. Try fewer than or more
than 6 characters. Try 6 characters, but have one of them not be a legal
base 16 digit.
Here is a demo of the incredible versatility and
power of the CGI.pm module. Posted late Monday evening, June 18th.
Lab #1 hands-on class follow up message.
We will thoroughly review the lab 1 class on Thursday, June 14th.
What to study from Greg Perry PERL in 24
Hours textbook for the Friday, June 15th hands-on lab class and
Monday, June 18th lecture class.
What to study for Unix from
the textbooks and future handouts and in-class group exercises.
Snowball sentences and Perl algorithms
to break a string into separate words, and remove all the punctuation.
snow.cgi PERL CGI script
that separates and displays the words of the snowball sentence.
Best to view this one with Netscape instead of Internet Explorer.
Lecture #1 review and example HTML FORM and
PERL/CGI script we will study for at least the rest of week #1,
and probably up until Wednesday, June 20th.
Compare this to your HTML, FORM, and PERL notes from the 1st class.
Much of this material will be handed out on Tuesday,
June 12th. Type in your name and the name of one of your VIP
friends, and try out the CGI script.
Hands-on class on Wednesday, June 13th.
Read about the internet account (internet password) and the newuser
account (newuser password).
User ID and password are needed to access this
web site. How can such authentication be set up? Its fairly
easy to to in PERL, but it will be a couple of weeks before we
look at the HOW. Check it out.
Experimenting with BGCOLOR and TEXT color.
Using the transliteration operator to count hexadecimal digits. Using the
PERL length function to count characters. Using random numbers to
generate a random color value (hexadecimal triplet).
- Simple HTML and pico editor example
for those new to pico or HTML tags.
How to use
pico editor on chaos.cns.uni.edu.
The pico name stands for pine composer, which
means that pico is the pine email editor or composer for the
sending and replying commands.
that are most commonly used.
We have used ls, ls -l, cd web, mkdir web, finger, who, w,
logout, etc. Read this page to learn more about the UNIX
commands you will use on chaos.cns.uni.edu.
- Here is the PERL FAQ Frequently
Asked Questions page from fall semester of 2000 for
the 810:022 class Microcomputer Applications and Systems
Integration. To be handed out on Thursday, June 14th in
- The binary, octal, hexadecimal handout
from Thursday, June 14th will be important in understanding
the HTML graphics that we do as well as grasping the chmod
Unix command and whether we need 755 or 644 and why.
- perl -e and running Perl statements
from the command line. Good examples of arrays and foreach
and for loops too.
- Shortcut to get to
and UNI Students Email home page.
- Web page tips and suggestions
SCC and Wright labs, as well as working from home, with or
without a modem or ISP.
There are two textbooks for the class. The Castro book costs $20 and the
Pierce book costs $25. The total textbook cost is happily well below the
average student textbook cost for a 3 hour credit class.
Textbook by Elizabeth Castro:
PERL and CGI
for the World Wide Web is the textbook.
The 2nd edition of this excellent text is just being published this month
(1st week of June of 2001). It will cost $20.
- Textbook by Clinton Pierce (with CD-ROM) is
Teach Yourself PERL in 24 Hours.
It includes PERL on CD-ROM, in case you want to install PERL on your
own PC. The cost of the book is $25.
The 810:088 PERL/CGI Web Programming has no prerequisites. Do not be
intimidated by the Instructor's permission required, as that is
just RED tape that goes along with the special
course number 810:088 no matter what the TOPIC is. Call me at 273-7172 or
email firstname.lastname@example.org if you have questions or want your student number
released to register for the class.
This course counts towards Microcomputer Certification
. It can be substituted for one of the other four classes.
The textbook or textbooks have not yet been selected. When they are
chosen, you will be notified here.
Here are several example PERL programs that illustrate the types
of things you will be able understand and do to before the 810:088 class
has its July 6th when the first half of the 8 week session ends.
- Writing your own
engine to help visitors to your web site find
which pages contain the keywords they are interested in.
June 6th, 2001 program
- Managing and sharing files from your web site.
FileSeek.cgi example offers your web site visitors a user friendly way
to find the files they want to look at or download.
FileSeek.cgi is New:
Friday, June 1st,
Randomly choose a quote to display, then generate
a web page to display it using PERL and CGI. Click the REFRESH or
the RELOAD button to see another quote.
- View a
guestbook PERL/CGI script program. Notice that everytime you
view the guestbook, the page color is a different randomly
chosen combination of background and text color.
- Taking a quiz that is graded by a PERL script.
Discrete quiz example.
Networking 810:023 Microcomputer Systems quiz example.
PERL and HTML and ACCESS 97 quiz example. Quiz consists
of only 6 questions. Notice the PERL program greets you
by time of day, mentions what day of the week it is, and what
day of the year it is (February 2nd would be day 33 of any
question quiz, with PhotoShop gradient background.
Radio buttons, Checkboxes and Textboxes illustrated.
PERL and C
compared by the author of Coy.pm PERL module that adds haiku poetry to
your PERL error messages.
Amazon.com: Can you tell us a bit about your Coy.pm module, which won the
1999 Larry Wall Award for Practical Utility?
Damian Conway: Coy is a little bit of whimsy, built on some fairly solid
computer science. Put simply, it replaces any error
messages a program generates with an English haiku.
For example, if you divide a number by zero in Perl
you get this:
Illegal division by zero at demo.pl line 4.
That's typical of error messages: curt, uncompromising, and accusatory.
It's no wonder programming is stressful. But if you add the Coy module to
your program, the same mistake produces this instead:
A songbird above a temple.
Con Wei dying
beside a river.
The Seventh Sage's commentary...
Illegal division by zero ("The Way of demo.pl": line 4)
You still get the same information, but packaged in a much more harmonious
and relaxing way! Coy even has subroutines that attempt to relate the
subject of the haiku to the error message itself (though the relationship
is often very oblique, as in the above example).
Coy generates a new and different haiku every time an error is detected,
so the error messages are always fresh, interesting, and unique. And that
actually seems to help people pay more attention to them.