#! /usr/bin/perl -w use strict; use Lingua::EN::Inflect qw/NUMWORDS ORD/; my @gift = ( 'this element purposely left blank', 'partridge in a pear tree', 'turtle doves', 'French hens', 'calling birds', 'golden rings', 'geese a-laying', 'swans a-swimmings', 'maids a-milkings', 'ladies dancing', 'lords a-leaping', 'pipers piping', 'drummers drumming', ); for my $day( 1..12 ) { print "On the ${\NUMWORDS(ORD($day))} day of Christmas,\nmy true love gave to me,\n"; if( $day > 1 ) { print "${\NUMWORDS($_)} $gift[$_],\n" for reverse 2..$day; print 'and '; } print "a $gift[1].\n\n"; }