Intro to
Programming
with Perl

Fall 2007
course
navigation

assignments

  due Mon Sep 10

preliminaries

  due Mon Sep 17

scalars and booleans

# get a substring of length 1 starting at character number 3 # (starting count at 0) print substr("012345", 3, 1);
Using substr() and ord() described on page 34, write a program that prints the ascii numbers for each letter in a word input by the user.
+ - * / ** . == < > <= >= eq lt gt le ge not ! and && or || cmp <=> print "answer='", ( 0 or 1 ), "'\n"; print "answer='", ( 8 <=> 10 ), "'\n"; print "answer='", ( 8 cmp 10 ), "'\n"; print "answer='", ( 3 < 5 and 10 > 7 ), "'\n"; print "answer='", ( 21 == 3 * 7 ), "'\n"; # why not (21=3*7) ? print "answer='", ( 0b101010 ), "'\n"; print "answer='", ( 0xFF ), "'\n";
  due Mon Sep 24

conditionals and loops

  due Mon Oct 1

lists

my ($foo, @foo, $x, @y, $list, @list, @alphabet); $foo = "hello"; $foo = ("hello"); $foo = ("hello", "goodbye"); @foo = ("hello"); @foo = ("hello", "goodbye"); print "The number of elements in \@foo is " . scalar(@foo) . "\n"; $x = @y = "hello"; # what is $x after this? $list = 100; @list = ('zero', 'one', 'two'); $list[0] = 0; print '@list is ' . " (@list) \n"; print '$list is ' . " $list \n"; @alphabet = 'a' .. 'z'; $a = pop(@alphabet); print "\$a is $a \n"; print 'while $a[-1] is \'' , $a[-1] , "'\n"; print 'and @alphabet is ' , @alphabet , "\n";
  due Mon Oct 8

hashes; subroutines part 1

  due Mon Oct 15

Regular Expression

  due Mon Oct 29

files and system

  due Wed Oct 31

midterm project

  due Mon Nov 5

references

  due Mon Nov 12

objects

  due Sun Nov 18

modules

  due Mon Dec 3

CGI

  due Mon Dec 10

CGI part 2

  due Fri Dec 14

final project

 

term grade

http://cs.marlboro.edu/ courses/ fall2007/perl/ special/assignments
last modified Thursday January 29 2009 4:48 am EST