Chapter 4 of Learning Perl.
% add 2
Please provide two arguments.
% add 2 -5
-3
% add 2 -5
Please provide two positive integers.
% order Fred Lucy
right order
% order Lucy Fred
wrong order
% reorder Fred Lucy
Fred Lucy
% reorder Lucy Fred
Fred Lucy
% same.pl
Enter string 1: lucy
Enter string 2: Lucy
different
% percent.pl 50 150
25%
% percent.pl 50 -50
You are trying to trick me! at line 4.
% percent.pl 50 150
25.00 %
% ssno.pl 058-28-1282
yes
% ssno.pl "bananas are yummy"
no
% pali.pl "Madam in Eden Im Adam"
yes!
% pali.pl ggaattcc
yes!
% pali.pl "cold spring harbor laboratory"
no!
% pali.pl "A man, a plan, a canal... Panama!
yes!
(Hint: Look up the s/// pattern matching & substitution function in the Perl
reference guide. We will cover this formally in a few days.)