use Lingua::EN::Inflect qw/inflect NUM PART_PRES/; use Lingua::Conjunction qw/conjunction/; my @gift = ( '', 'partridge in a pear tree', 'turtle dove', 'French hen', 'calling bird', 'gold ring', 'goose', 'swan', 'maid', 'lady', 'lord', 'piper', 'drummer', ); my @action = map {$_ && PART_PRES $_} ( '', '', '', '', '', '', ' a-lay', ' a-swim', ' a-milk', ' dance', ' a-leap', ' pipe', ' drum', ); for my $day( 1..12 ) { print inflect("On the NUMWORDS(ORD($day)) day of Christmas,\n"), "my true love gave to me:", conjunction( map { NUM($_); inflect "\n\tA(PL_N($gift[$_]))$action[$_]"} reverse 1..$day ), ".\n\n"; } #### use Lingua::EN::Inflect qw/inflect NUM PART_PRES/; use Lingua::Conjunction qw/conjunction/; my @gift = ( '', 'Swiss Army switch statement', 'style of OO', 'loop type', 'sigil fix', 'catch block', 'junction', 'ref', 'sub', 'type', 'try', 'function', 'less-than', ); my @action = map {$_ && PART_PRES $_} ( '', '', '', '', '', '', ' OR', ' a-bind', ' overload', ' a-check', ' a-catch', ' curry', ' chain', ); for my $apo ( 1..12 ) { print inflect("In the NUMWORDS(ORD($apo)) Perl Apocalypse,\n"), "my Larry gave to me:", conjunction( map { NUM($_); inflect "\n\tA(PL_N($gift[$_]))$action[$_]"} reverse 1..$apo ), ".\n\n"; } ;-)