#!/usr/bin/perl use strict; use Tie::Cycle; tie my $parent, 'Tie::Cycle', [ qw(Mama Papa) ]; tie my $head_owner, 'Tie::Cycle', [ qw(his her) ]; my $monkeys = 5; do { print "$monkeys little monkeys jumping on the bed,\n"; print "One fell off and bumped $head_owner head.\n"; print "$parent called the Doctor and the Doctor said,\n"; (--$monkeys) ? print "\"No more monkeys jumping on the bed!\"\n\n" : print "\"Put those monkeys straight to bed!\"\n\n\n"; } while ($monkeys);