UPDATE: Dec 19,2005 I put this to midi music in a karaoke file !! Just in time for the christmas parties. :-) See karaoke files for the midis, and the Perl scripts which generate the midi(kar) files.(Thanks to Mr. Muskrat :-) )

#!/usr/bin/perl use warnings; use strict; my @gifts = <DATA>; my @days = qw(1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th); my @dayspast; while(@days){ my $day = shift @days; push @dayspast, $day; my ($num) = $day =~ /(\d+).*/; print "On the $day day of Christmas,\nMy true Perl gave to me\n"; foreach my $gift (reverse @dayspast){ my ($n) = $gift =~ /(\d+).*/; print $gifts[$n - 1]; } print "\n"; if(scalar @dayspast == 1) {$gifts[0] = 'And '.$gifts[0]} } exit; __DATA__ a commandline in an @ARGV 2 sca-lars 3 ar-rays 4 nested hash 5 ENCODED STRINGS 6 threads-a-spawning 7 procs-a-forking 8 tests succeeding 9 modules loading 10 objects blessing 11 signals catching 12 saints-a-drinking

I'm not really a human, but I play one on earth. flash japh

In reply to 12 Days of Christmas by zentara

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.