
Go backward to 4.1 CGI Introduction Topic
Go up to 4 Major Topics
Go forward to 4.3 Individual Server Side Include Topic
4.2 Individual CGI Introduction to Perl Topic
The purpose of this section is to introduce Perl
programming. It won't teach you programming, and it won't even teach you all
of Perl. But it should get you started writing Perl programs that can do
something useful.
Preparation for this section requires you do some Perl programming.
This programming needs to include the following:
- Open and closing files.
- Reading the content of a file and finding the end-of-file.
- Using arrays.
- Using associative arrays.
- Manipulate numeric and string values.
Please read the following:
- Learning Perl by Schwartz, & Christansen. Up through chapter 5.
- Programming Perl by Wall, Christansen, & Schwartz.
Pattern-Matching Operators
page 69-76.
- Programming Perl by Wall, Christansen, & Schwartz.
chomp
& chop
page 149-150.
- Programming Perl by Wall, Christansen, & Schwartz.
split
page 220.
- About tables in HTML
Write a little "test" program for each programming construct above.
You are also welcome to tie them into a single program
You will need to write a program that reads the file
/etc/passwd
and creates an HTML table for our class and
another table for other users.
The program will need to write HTML with a title, header, and tables.
For the both tables print out a sequence number, the real
names, user names, and e-mail addresses
of the members of your group. The class this semester seems to have the
group ID of 101.
For extra credit, look in /etc/group for the same group number and
include the users added to group in the group file as well.
Print out the names in alphabetic order by last name.
Set up the names as a link to
the individuals index.html
.
Set up the username as mailto
links.
for an e-mail address assume the e-mail address is on system "cgi".
If you get your mail someplace else, please put your forwarding address
in the file .forward.
For the second table do the same for all other users with a user ID
greater than or equal to 1000.
- Test your program on the command line without a web browser.
- Move your program and data to the
cgi-bin
, set the correct
permissions on your files, and execute it from a web browser.
- Modify your
index.html
so that it points to your program.
For your information the format of the password file looks like this:
ltaber:x:1038:1038:Louis Taber,R5A,,:/home/ltaber:/usr/bin/tcsh
Look at the file for the actual format.
The fields are:
- User name
- Place holder for password.
- UID (User IDentification number)
- GID (Group IDentification number)
- User information
- Users real name, first name first
- Comma separated room number
- Comma separated phone numbers
- Path to initial home directory.
- Program to run.
Place your report in the turn in box in the lab.
It need the following:
- CSC266 Topic: 4.2: Perl 1
- Printout of your Perl program.
- The URL of your program.
- A printout of your page from a web browser.
- Your suggestions on topic.
Instructor: ltaber@pima.edu** My new Home on phRed** The Pima College Site** The Mad Dr. G.'s home page on phred.
