#!/usr/local/bin/perl # Jaime Prilusky,2002 # add 's' nor nor accordingly to the number of elements foreach $numberOfPages ( 0 .. 5) { my $s = ($numberOfPages == 1) ? " " : "s"; print "counted $numberOfPages page${s}\n"; }