MC logo

Code Examples

^  CSc 231 Perl

This page links a large number of small code examples for use in lecture.

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