Code Examples
CSc 231 Perl
This page links a large number of small code examples for use in lecture.
Basic Constructs
Perl Hello, World!
Hello Again
Scalar Variables
Arrays
Hashes
Arrays and Hashes Together
The Strict Pragma
Loops, Arguments, I/O
While Loop
Echo I
Echo II
Echo III
Echo IV
Control Constructs
Postfix Control Constructs
Args I
Args II: The For Loop
Args III: The Foreach Loop
Args IV
Args V
Environment I
Environment II
Turbo Hello, World
Files
File Reader I
File Reader II
File Reader III
File Copier
Functions
Array Assignments
Functions And Arguments
Using Arguments I
Using Arguments II
Using Arguments III
Patterns
Count Blank Lines I
Count Blank Lines II
Check C Programs
Applet Viewer
UID Lookup
Link Finder I
Link Finder II
Link Finder III
Apache Log Reader
Generating HTML
HTML File Display
Text to HTML Translator
HTML Table Generator
References, Packages and Objects
Perl References
Simple Module
Module Test Driver
Simple Class
Class Test Driver
Perl/Tk GUIs
TK Buttons I
TK Buttons II
TK Color Buttons I
TK Color Buttons II
FTP Download GUI
Network Clients
Email Address Client
Web Page Parser
FTP Synchroniz