Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

cwest (1514)

  (email not shown publicly)
AOL IM: caseyrwest (Add Buddy, Send Message)

Perl geek.

Journal of cwest (1514)

Friday March 19, 2004
12:15 PM


[ #17969 ]

As a gift to you on my birthday, I'll golf the birthday song. The shortest I've seen before goes like this.

for(('to you')x2,"dear $ARGV[0]",'to you'){print"Happy Birthday $_"}

Which could be reduced to the following.

print"Happy Birthday $_"for("to you")x2,"dear ".pop,"to you"

So here's my entry.

print"Happy Birthday ",$_%3?"to you":"dear ".pop for 1..4

Since spring is tomorrow, my website has changed for the season again. I hope you enjoy the colors.

Posted from, comment here.