Pearls of Perl

David J. Ritchie

November 14, 2003
Original: October 23, 1999

The purpose of this document is to introduce you to the programming language called Perl by means of a step-by-step exploration of the features (the pearls) of the programming language. By the end of the steps, you should be able to begin to write a simple adventure game.


© 2003 by David J. Ritchie

David@DavidJRitchie.com

http://www.DavidJRitchie.com/

Permission is given to copy and distribute this document provided that:

  1. it is done so without charge,

  2. the document is not modified, and

  3. the copyright notice, the e-mail address, and the web site address are included, and

  4. this paragraph is clearly readable within the first two pages of the document.


Table of Contents

Table of Contents

Preface

Introduction

A Sentence

A Paragraph

A Single Thing

$Containers

Many Things

@Containers

Pretty Output

Give Me An A

Input, If's And Paragraphs

Where Am I?

A Loop With For

A Loop With Foreach

A Loop With While

Where Am I? Again And Again

Printing Multiple Lines

Subroutines

Subroutines With Return Values

Subroutines With Arguments

An Adventure Game

For Those Who Would Teach Perl in Middle School


Preface

Acknowledgments

I could not have done this without the cooperation, partnering and support of many people throughout Naperville Community Unit School District 203. In particular, I would like to thank my several teacher and/or instructional coordinator partners (Margaret Gilmore, Kerry Winborne, Mary Riordan), Washington Principal Mark Pasztor as well as the Principals at the other Middle Schools, Technology Director Skip Paulson, and the several Technology personnel (Karen Gallois, Tracy Oliver, Judy Aberholden and several others).

Copyright Matters

This and most, if not all, of the other documents are ©2003 by David J. Ritchie. However, I have made the provisions surrounding the copyright very open, requiring only that (a) you not charge for the document, (b) you not modify the document, and (c) that you make sure that my web site address and e-mail address are clearly readable within the first two pages of the document. (Note: the newsletter copyrights still need updating to these terms; I will do so eventually.)

The First Lesson

Start the Perl lessons with a short talk to the students about the meaning of copyright, credits, and licenses. State that they are expected to adhere to their School District's proper computer use policy. State that they are not to use what is about to be taught to them for bad purposes like breaking into people's computer systems. State that they are to use the knowledge that they will gain for good--not for evil.

To help that statement sink in, ask that they, with you, recite the rule that students of medicine are asked to follow--namely...

First, Do No Harm.

State that those who created and developed Perl have given them a gift in allowing them to use what they developed for free. Ask that once they have learned Perl and done some cool things with it, they repay that gift by giving back something that they have developed.

Explain that what is being discussed here are the rules for dealing with this document as an intellectual property and the proper way in which they are to use computing and computing technology. State that as beginners it is important that they know these things so that they don't, out of ignorance, get themselves in trouble with the knowledge that they have been given.

As an Example

As an example of giving back, state that the author of this document has put it up on the web for their benefit and after learning from it, they are to pass it on. It's now their turn to give back.

David J. Ritchie
Naperville, Illinois, USA
November 2003


Introduction

The Perl programs that are used as part of the lessons are given in the text below. To do the lessons, enter the programs listed using a simple text editor. On a Windows computer, a good simple text editor to use is "Notepad" which you will find under Start -> Programs -> Accessories. On a Macintosh computer, a good simple text editor to use is "SimpleText" which you will find in a number of places on your Hard Drive. On a Linux or Unix computer, a good simple text editor is "vi".

You will need to have Perl on your computer. If you do not have Perl on your computer, the step-by-step instructions at How To Obtain Perl may help.  (At the present time, only step-by-step instructions for obtain Perl for a Windows or Windows-like computer are provided.)

For each program file...


A Sentence

Your Goal

Perl is made up of sentences. Each has a subject, a verb, a direct object and a final punctuation mark. The direct object is a "thing"--some thing that means something to you, the person writing the program. It might be a number like "1.25" or a set of letters like your name, or a container that holds those things (which your program has put there previously).

Open the file named "a sentence" provided on your floppy disk and try it out. Here it is:

 

The Program

# a sentence 
#
# A sentence is:
# an invisible subject (assumed to be "you computer")
# a verb (print)
# a direct object (1.2345) (which is the verb should affect, AND
# a final punctuation mark (a semicolon)
print 1.2345;
#-------------

The Questions

  1. Is there a Perl sentence in the above program?

  2. If so, what is it?

  3. What is the verb?

  4. What is the direct object?

  5. What is the "thing"?

  6. Was the punctuation mark present?


A Paragraph

Your Goal
Perl sentences can be grouped as blocks. A block begins with an opening brace {. A block ends with a closing brace }. Blocks can be nested inside of other blocks. Usually, the computer reads and does the entire block. Later on, you will see how to make it skip the entire block.

Open the file named "a paragraph" provided on your floppy disk and try it out. Here it is:

 

The Program

# a paragraph
# a paragraph is one or more sentences grouped with braces { }

{
print 1;
print 2;
print 3;
}
#
#---------------

The Questions

  1. What is the paragraph in the above example?

  2. Circle the opening brace and the closing brace.


A Single Thing

Your Goal

Perl programs consider numbers to be single things with no other meaning to Perl than just being a number. Letters need to be surrounded by double quotes to be considered a "single thing with no other meaning to Perl."

Without the quotes, the letters could be something else. For example, the letters "p", "r", "i","n", and "t", when put together as "print" might be a "single thing with no other meaning" or might be a command. By putting double quotes around print, you can make sure that Perl treats it as a single thing--not a command.

Open the file named "a single thing" provided on your floppy disk and try it out. Here it is:

 

The Program

# a single thing 
#
# Under the Script pull down menu, select "Compiler Warnings"
# so that it has a check beside it and then run this script
#
# numbers by themselves are recognized as single things
# they don't need double quotes around them
$a = 1.23457;
print $a;
#
# letters by themselves are NOT recognized as single things.
$b = abcd;
print $b;
#
# put double quotes to make it a single thing
$c = "abcd";
print $c;
#
# Double quotes can be put around numbers but it is not needed.
$d = "1.23457";
print $d;
#
#--------------------------

The Questions

  1. What are the number single things above?

  2. What are the letter single things above?


$Containers

Your Goal

Perl programs use $containers. These containers can hold a single thing.

Open the file named "$container" provided on your floppy disk and try it out. Here it is:

 

The Program

# $container 
#
# A $container holds one thing
$a = 26;
print $a;
$b = 32;
print $b;
# You can add the contents of two containers together.
$c = $a + $b;
print $c;
#-------------

The Questions

  1. What are the names of the $containers above?

  2. Did combining two containers by addition do what you expected it to do?


Many Things

Your Goal
Perl programs specify many things as a group of single things by separating the single things with commas and surrounding them with parentheses. The group of single things is called a list.

Open the file named "many things" provided on your floppy disk and try it out. Here it is:

 

The Program

# many things 
# many single things are grouped together as a list
# a list is written as single things separated by commas and usually
# surrounded by parentheses
print (1, "a", 3, "b");
print (5, "cd", 7, "efg");
#------------------

The Questions

  1. How many single things are there in the program?

  2. How many groups of single things are there in the program?


@Containers

Your Goal

Perl programs use @ containers to hold many single things. Remember from before that single things can be either numbers or letters provided that the letters are enclosed in double quotes to tell Perl that they are to be treated as single things.

The single things in an @ container are numbered beginning with 0. If you have an @ container named @box, then you refer to the first single thing in @box as $box[0].

You know it is a single thing because its name begins with a $. You know it is part of an @container because it has [0] after its name. The @ container which holds this single thing is the one which has the same name, namely, @box.

The number of the last single thing in @box is $#box. The last single thing itself is therefore $box[$#box].

To combine two @containers into a new @container, simply make the two @containers into a list and store it into the new @container.

@containers are usually called arrays.

Open the file named "@containers" provided on your floppy disk and try it out. Here it is:

 

The Program

# @containers 
#
# an @container holds many single things given as a list
@a = (1, "washington", 3);
print @a;
@b = (4, "junior", 6);
print @b;
@c = (7, "high", 8);
print @c;
@d = (@a, @b, @c);
print @d;
#
#------------

The Questions

  1. What are the names of the @containers above

  2. Did combining two @containers by grouping them together with commas and parentheses do what you expected it to do?


Pretty Output

Your Goal

You can make your output from print statements easier to read by including spaces, text, and "new lines". You do this by including the spaces and text as part of the print command "direct object" and by including special code words inside the double quotes that tell Perl to insert a new line. The code word for new line is "\n".

You can make your output easier to code by taking advantage of "interpolation". "Interpolation" means that whenever Perl sees a $ or an @ container inside of a set of double quotes, it will replace the $ or @ variable with the value of the contents of the container.

Open the file named "pretty output" provided on your floppy disk and try it out. Here it is:

 

The Program

# pretty output 
#
# to make your print out pretty put in spaces
$a = 1.2345;
$b = "I am a b";
print "a = ", $a, " b = ", $b;
#
# to put out "new lines", print a \n in double quotes
print "\n", "a = ", $a, "\n", "b = ", $b, "\n";
#
# to save yourself work, put variables inside the double quotes
print "\n", "a = $a \n b = $b \n";
#----------------------

The Questions

  1. The above shows the use of interpolation for $ containers. Do you think it would work for @containers?

  2. Try modifying the above to have @containers. Did it work?


Give Me An A

Your Goal

You may obtain input (whatever is typed) from the keyboard by putting information from <STDIN> into a $container. The $ container receives all the characters typed (even if they don't appear). For example, because you must end the keyboard input by pressing "return" or "enter", the $ container will receive a new line variable as the result of your ending the input.

Open the file named "give me an A" provided on your floppy disk and try it out. Here it is:

 

The Program

# 
# to obtain input from the keyboard use Standard Input <STDIN>
# you need to tell the person that you want input.
print "\n", "Give me an A!", "\n";
$A = <STDIN>;
print "\n", "You gave me an: ", $A;
#---------------

The Questions

  1. Can you tell if the final return or enter was present in the the $A variable?

  2. Does it matter whether or not <STDIN> or <stdin> is used?

 


Input, If's And Paragraphs

Your Goal

Once you have given the user a prompt to tell them to enter some input and accepted the input into a Perl variable, you then have to program the computer to determine what input was given. One way to do this is to use "if" statements which, when true, cause the computer to read and process one block of code instead of another.

An "if" statement is usually written as:

if ( $container eq "letters") { 
# Perl done if true
# more Perl done if true
# more Perl done if true
}
# Perl done regardless
# Perl done regardless

There are many kinds of "if" statements. You can write "ne" instead of "eq" if you want the block of Perl done if the contents of the container is not equal to "letters". You can write == if the contents of the $container is a number and you want to check against a number instead of "letters". E.g.,

if ( $container == 3.14) { 
# Perl done if true
# more Perl done if true
# more Perl done if true
}
# Perl done regardless
# Perl done regardless

You can use <= for "less than or numerically equal", >= for "greater than or numerically equal", and != for "not numerically equal".

You can say "if ( something eq "stuff") { do block} else {do other block}" for example.

Open the file named "input, if's and paragraphs" provided on your floppy disk and try it out. Here it is:

 

The Program

# 
# input, if's and paragraphs
#
# prompt the user...
print "\n", "Give me an A","\n";
#
# wait for input
$A = <STDIN>;
#
# if we got an A and a new line, then do a paragraph
if ($A eq "A\n") {
print "\n", "We Got It!";
print "\n", "Hooray!";
}
#
# if we did not get an A and a new line,
# then do a different paragraph
if ($A ne "A\n") {
print "\n", "We Missed It!";
print "\n", "Too bad!";
}
#-----------------

The Questions

  1. Does it make any difference whether a lower case "a" or an upper case "A" is typed?

  2. The chomp statement as in

  3. chomp($A);

    will eliminate the last character from $A. Use chomp to take the "new line" character off of $A after reading the contents from <STDIN>. How will you have to change the if statement?

  4. Now, change the inside of the parentheses of the if statement from $A .eq. "A" to $A = = 13.5 and see what happens when you are asking that 13.5 be entered.


Where Am I?

Your Goal

This program uses single things, $Containers, many things, @Containers, input from the keyboard, output to the screen, and if statements-all the things you have learned so far in this course. It receives a number from the keyboard and prints out what the room is for that number if it is within the range of the numbers in the house.

Open the file named "where am i?" provided on your floppy disk and try it out. Here it is:

 

The Program

# 
# where am i?
#
# Set up the rooms
@RoomList = ("Bedroom", "Den", "Kitchen", "Family Room");
#
# first, start things off
print "\n", "Give me a room number: ";
$RoomNumber = <STDIN>;
#
if ($RoomNumber >= 0 and $RoomNumber <= $#RoomList ) {
print "\n", "Room is: ", $RoomList[$RoomNumber];
} else {
print "\n", "No such room";
}
#-----------------------

The Questions

  1. Try changing the names of the rooms. Run it and see if it still works. Does it?

  2. Try changing the number of rooms. Run it and see if it still works. Does it?


A Loop With For

Your Goal

There are many ways to make the computer read and process the same set of statements over and over. The one given here in the program is something you should use when you have to keep a count of how many times the computer has read and processed the loop. The block (paragraph) is the set of statements that is read and processed over and over again.

Open the file named "a loop with for" provided on your floppy disk and try it out. Here it is:

 

The Program

# a loop with for 
#
# there are many ways to do loops
#
# you can use a for statement
#
# for a value of i beginning at 1,
# up to and including 10, increasing by 1 for each loop
for ($i = 1; $i <= 10; $i = $i + 1) {
print "\n", "i = ", $i;
}
#
# say done
print "\n", "the end";
#----------------------------

The Questions

  1. Can you make this count by 2's?

  2. Can you make this start at 10 and go down to 0?


A Loop With Foreach

Your Goal

There are many ways to make the computer read and process the same set of statements over and over. The one given here in the program is something you should use when you just want to go through all the single things in a list without keeping track of a count.

Open the file named "a loop with foreach" provided on your floppy disk and try it out. Here it is:

 

The Program

# a loop with foreach 
#
# there are many ways to do loops
#
# you can use a foreach statement when you have a list
# and you want to do something to each item
# in the list
#
foreach $item (1, 2, "abc", 4, "def", 4, 3, "ghi", 1, 0) {
print "\n", $item;
}
#
# store a list of single things in an @container
@Shelf = ("book", "vase", "lamp");
foreach $thing (@Shelf) {
print "\n", $thing;
}
#
# say done
print "\n", "the end";
#------------------

The Questions

  1. How many foreach loops are there in this program?

  2. What is it that we wanted to do to each item in the list given to the foreach statement?


A Loop With While

Your Goal

The last kind of loop we are going to discuss is a "while" loop. Here the form is while some thing is true do this block of Perl statements.

Open the file named "a loop with while" provided on your floppy disk and try it out. Here it is:

 

The Program

# a loop with while 
#
# there are many ways to do loops
#
# you can use a while statement
#
# first, start things off
print "\n", "Give me an A: ";
$A = <STDIN>;
#
# now loop
while ( $A eq "A\n") {
print "\n", "Give me another A: ";
$A = <STDIN>;
}
#
# We come here when we don't get another A
print "\n", "I said I wanted an A!!!!";
#-----------------

The Questions

  1. What are the statements that are being read and processed over and over again as long as an A is typed?

  2. Use "ne" instead of "eq" to make the while loop continue to loop as long as an A is NOT typed. Does your program work?


Where Am I? Again And Again

Your Goal

This program uses all the things of the previous "room" example and goes on to use while loops-all the things you have learned so far in this course. In addition to printing out what the room is for the number entered, it also prints out what is in that room. It does this until you enter the number of a room that does not exist and it then quits.

Open the file named "where am I? again and again" provided on your floppy disk and try it out. Here it is:

 

The Program

# Where Am I? Again and Again 
#
# Set up the rooms
@RoomList = ("Bedroom", "Den", "Kitchen", "Family Room");
@RoomThing = ("Pillow", "Book", "Plate", "Magazine");
#
# first, start things off
print "\n", "Give me a room number: ";
$RoomNumber = <STDIN>;
#
# now process what was entered and ask again if OK room
while ($RoomNumber >= 0 and $RoomNumber <= $#RoomList ) {
print "\n", "Room is: ", $RoomList[$RoomNumber];
print "\n", "There is a ", $RoomThing[$RoomNumber], " here.";
print "\n\n", "Give me a room number: ";
$RoomNumber = <STDIN>;
}
print "\n", "No such room";
#------------

The Questions

  1. Try changing the names of the rooms. Run it and see if it still works. Does it?

  2. Try changing the number of rooms. Run it and see if it still works. Does it?


Printing Multiple Lines

Your Goal

You can specify multiple lines of text to be printed by using a technique known as "Here" documents. You can specify many lines this way. Here is an example:

print <<END;
This text will be printed up to a line having END on it by itself.
END

The line just before the lines to be printed has double "greater than" signs ("<<"). Immediately following the "<<" is the text which indicates the end of the lines to be printed (when it is found on a line by itself). In the above example, the text is END.

The text begins on the line following the "<<" and continues up until (but not including) the line with the text on it by itself which followed the "<<". In computer terms, this is called a "here-document" syntax. You can think of the syntax as saying "the document I want you to print is here ." Note that as with double quoted text, $variable and @ array interpolation works.

Open the file named "here" provided on your floppy disk and try it out. Here it is:

# a here document
$A = "certainly";
print <<STUFF;
This will $A be printed but the next line won't.
STUFF
#
$wait = <STDIN>;

The Questions

  1. What will be printed?

  2. Could I use "OUCH" instead of "STUFF"?


Subroutines

Your Goal

You can give a block of Perl a name. This is called "defining a subroutine". Then, when you want to have the computer do the Perl block, you can simply write the name. This is called "calling the subroutine." Here is an example:

sub Beany { print "this";}
Beany ();

The first line defines the subroutine "Beany". The name is given ("Beany") and the definition of the subroutine is given (the block immediately following Beany).

The second line calls the subroutine. When the computer does this line, it will do the Perl block. In this case, it will print "this".

Open the file named "sub" provided on your floppy disk and try it out. Here it is:

#a subroutine
sub Barney {
print 1;
print 2;
print 3;
}
Barney ();
#
$wait = <STDIN>;

The Questions

  1. What is the subroutine definition in the above example?

  2. Circle the opening and closing brace of the block whose name is Barney.

  3. What line invokes the subroutine?

  4. When you ran the program did the computer do the subroutine?

Subroutines With Return Values

Your Goal

Understand that Perl subroutines can return values. Know that return values allow you to send back information to the part of the program that called the subroutine.

You can have a subroutine return a value. This value can be used by the Perl statement that called you. Here is an example:

sub Beany { return "Barney";}
print Beany ();

The first line defines the subroutine "Beany" to return the value "Barney".

The second line calls the subroutine as part of the "print" statement. When the computer does this line, it will call the subroutine, get the returned value, and print that value. In this case, it will print "Barney".

Open the file named "subret" provided on your floppy disk and try it out. Here it is:

 
# a subroutine
sub Barney {
$i = "And Friends";
return $i;
}
$j = Barney ();
print $j;
#
$wait = <STDIN>;

The Questions

  1. What is the value returned by the subroutine in the above example?

  2. How could you eliminate $j in the above example?

 

Subroutines With Arguments

Your Goal

You can give a subroutine values to use as part of its processing. These values are called arguments.

The arguments make use of a special variable denoted by "_", the underscore symbol. The symbol @_ stands for the array of all the arguments passed to the subroutine. The symbol $_[0] stands for the first argument. The second, third, etc., arguments are given by $_[1], $_[2], etc.

Open the file named "subarg" provided on your floppy disk and try it out. Here it is:

#a subroutine
sub Barney {
$i = $_[0];
print "i is: ", $i;
return;
}
$i = "And Friends";
Barney ($i);
#
$wait = <STDIN>;

The Questions

  1. What is the value being given to the subroutine in the above example?

  2. Give an example with two arguments.

An Adventure Game

Your Goal

The Perl program below is an "adventure game". Another term might be a "role playing game" or an RPG game. When you run it, it takes you through a set of "adventure" scenes.

This program is very simple because it only has two "adventure scenes."

The Questions

  1. How can you change the scenes of this adventure?

  2. How can you add another page to this adventure?

  3. What is the variable that contains the current page number of the adventure?

#################################################
# Main Adventure Game Program #
# Copyright 1999 David J. Ritchie #
#################################################
#
# Say Hello...
# Do preliminaries...
print "\n\nWelcome to my Adventure Game\n";
print "Please tell me your name: ";
$Name = <STDIN>;
print "\n";
chomp $Name;
$Page = 1;
#
# Do Adventure Game Loop...
while ($Page > 0 ) {
if ($Page == 1) { $NextPage = Page1();}
if ($Page == 2) { $NextPage = Page2();}
$Page = $NextPage
}
#
# Say Goodbye...
print "\n$Name, thanks for playing!\nGoodbye\n";
exit;

#################################################
# Page Subroutines #
#################################################
##########
# Page 1 #
##########
sub Page1 {
print <<END;
Hello, $Name. Do you want to go ahead or quit?
END
$Choice = Choose("Ahead", 2,"Quit", 0);
return ($Choice);
}


##########
# Page 2 #
##########
sub Page2 {
print <<END;

You went ahead. Do you want to go back or quit?
END
$Choice = Choose("Back", 1, "Quit", 0);
return ($Choice);
}

#################################################
# Utility Routine to help with choosing options #
#################################################
sub Choose {
# get arguments
$Atext = $_[0];
$Apage = $_[1];
$Btext = $_[2];
$Bpage = $_[3];
# indicate we need a response and prompt for one
$NeedResponse = 1;
print "\nWhat is your choice--\nA ($Atext), \nB ($Btext), or \nQ (Quit)\n? ";
# while we still need a response
while ($NeedResponse) {
# get something from the keyboard,
# remove new line and make upper case
$Response = <STDIN>;
chomp $Response;
$Response = uc($Response);
# according to response, say we still need a
# response or not and specify page
if ($Response eq "A") {
$NeedResponse = 0;
$ChosenPage = $Apage;
} elsif ($Response eq "B") {
$NeedResponse = 0;
$ChosenPage = $Bpage;
} elsif ($Response eq "Q") {
$NeedResponse = 0;
$ChosenPage = -1;
} else {
print "\nChoose A, B, or Q: ";
$NeedResponse = 1;
}
} # end of while loop
return $ChosenPage;
}

For Those Who Would Teach Perl in Middle School

History

Some time in 1997 or 1998,  having spent quite a while writing programs in Perl to provide the web front end for the product data management system that was used to track the construction of the SVX detector for CDF at Fermilab (now running quite successfully as this picture shows), I got the idea to teach Perl to the students in the Computer Club at my son's middle school, Washington Junior High School.

Several Attempts

My first attempt was somewhat successful. See the discussion here for the details. Handouts 1, 2, 3, 4, 5 and 6 of what is essentially a textbook in Learning How To Program in Perl that were used for the Computer Club sessions may also be found there. The students taught me a lot, leading me to revise my approach. In addition, I developed a Mars Voyage simulation program in Perl for an Advanced Space Camp unit. That effort is described here.

The result is this document which I have used at three different Middle Schools for three different Computer Club multi-week, one hour per week, after school sessions. In addition, there are some PDF format companion Perl Topic Computer Club Newsletters Issues 1, 2, 3, 4, 5, and 6. The materials have therefore been classroom-tested in real circumstances by students with a wide distribution of talents.

Approach

The approach taken is to treat learning to program in Perl as a "Language Art" and thereby to connect it to the many other activities relating to Language Arts within the Middle School curriculum. For that reason, some effort is made to begin with concepts of English grammar and to use those concepts as a way of making the constructs in Perl familiar to the students. Most have had five years of Language Arts instruction so this approach springboards off their prior learning.

In addition there was (and is) a strong push for literacy in the several Middle Schools in which I have done this unit. For that reason, the goal of this Perl unit is to have the students write their own story in the style of an "Adventure" game or the very popular "Choose Your Own Adventure" series of books. At the end of one multi-week session at Madison Junior High School, the students had individually constructed sixteen different "adventure" stories--ranging from Teletubbies to "Bill Gates versus Apple Computer." Based on their enthusiastic playing of their Adventure games and those of their fellow club members, the unit was quite a success. With a similar experience at Jefferson Junior High School, I have concluded that the approach is headed in the right direction.

In addition to the Language Arts portion of the Middle School curriculum, I also made an effort in developing these materials to connect them to the Goals #1 through #5 of K-12 Technology Outcomes published by the district. As far as technology goes, the original sessions in 1998 were done on the LRC Computer Lab's Mac's using Perl for that platform. In 1999, the sessions were done on PC's under WNT using Perl for WNT. Both platforms have their pluses and minuses. What was great was that the students were quite flexible and were happy to use either. For that matter, so was Perl.

Importance of Connecting to the Curriculum

I would like to emphasize the importance of this "curriculum connection," both in the Language Arts and Technology areas, to the success of this effort. Even though this has been an after school activity and even though it has been implemented by significant volunteer efforts, it still requires resources from the school district at several different levels. In getting something like this going, the question naturally comes up, asked by school district staff, if not by taxpayers, "Why are we doing this?"

It is very important to be able to answer that question by referencing the points in the district's agreed-upon curriculum. Activities that can not do that satisfactorily almost certainly will (and should) take a back seat to those that can. It is my experience that educators thoroughly understand this but technologists (such as myself) at first do not and are often puzzled when their favorite "let's teach the kids this" technology idea runs into difficulty getting implemented. (If your district does not have an agreed-upon, preferably published and on the web curriculum / outcomes document similar to what has been referenced above, then I'd say you've got causes for concern that go beyond whether or not the students learn Perl.)

I strongly recommend that technologists who are trying to implement something similar to what I have done take note, study the curriculum documents, and make sure that they themselves can trace the connection from the points in those documents to what they would like to teach the students. They will then understand why they are teaching the students a particular thing. They will also be able to communicate the rationale to others ranging from their partner teachers to their School Board President. Those individuals will then have the ammunition necessary to lobby on behalf of the proposed activity. This will increase greatly its chances of adoption. Or, more simply put, in the words said to me long ago by Ruth Cross, my son's Elementary School Principal...

"Curriculum! Curriculum! Curriculum!".