Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

kids song

by ciderpunx (Vicar)
on Nov 08, 2007 at 11:32 UTC ( [id://649692]=poem: print w/replies, xml ) Need Help??

I've had this kids classic stuck in my head all morning. I thought that rewriting it in perl may help budge it.
Update: It didn't.
#!/usr/bin/perl @num = qw|zero one two three four five six seven eight nine ten|; for (1..10) { print mow($_) . " went to mow,\nwent to mow a meadow\n"; print mow($_) . ( $_ == 1 ? " and his dog\nwent to mow a meadow\n" : ", " ) for (reverse 1..$_); } sub mow($) { "$num[$_] m" . (shift == 1 ? 'a' : 'e') . 'n'; }
--
Linux, perl, punk rock, cider: charlieharvey.org.uk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: poem [id://649692]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found