For my daughter...

#!/usr/bin/perl -w use strict; hush( "little baby" ); sub hush { my $papa = bless {}, 'Daddy'; print "Hush ",shift,",\n"; print "Don't say a word.\n"; if ( $papa->buy_you( "mockingbird" )->("doesn't sing") ) { if ( $papa->buy_you( "diamond ring" )->("turns brass") ) { if ( $papa->buy_you( "looking glass" )->("gets broke") ) { if ( $papa->buy_you( "billy goat" )->("won't pull") ) { if ( $papa->buy_you( "cart and bull" )->("falls down") ) { print "You'll still be the prettiest baby in town.\n"; } } } } } } package Daddy; sub buy_you { my $gift = $_[1]; print "Papa's gonna buy you a $gift.\n\n"; return sub { print "And if that $gift ", shift, ",\n" } }

If you know other lyrics to this, please let me know. This is a traditional song with seemingly countless versions and I'm trying to collect as many as I can. For instance, other common gifts include "a dog named rover", "a diamond mine", "a horse and cart", "a cart and mule", or "a shetland pony" though there are many others too.

In other variations the last line is sometimes changed to "Papa's gonna buy you another one day" or "So hush little baby, don't you cry/Your Mommy loves you and so do I." In all versions, "Papa" can be switched for "Daddy", "Mommy", or "Mama." Some versions use "show" instead of "buy."

How did your parents sing it to you?

Edit: moved the articles to eliminate printing the lyrics like "If that a mockingbird . . .". Also changed $something to $gift for readability.

-sauoq
"My two cents aren't worth a dime.";

In reply to A Lullabye by sauoq

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.