in reply to Golf code in perl

🏌

Curiously, in addition to code golf, I've enjoyed a life long passion for real, physical golf. Though I can't compete with Tiger Woods (either on or off the golf course), my golf was once strong enough to represent my club in pennant matches. I fondly remember competing against other clubs in the good ol' days, especially punching the air with my fist while eyeballing my match play opponent after holing a crucial putt from the edge of the green. Though unable to physically eyeball my code golf opponents nowadays, I do frequently indulge in Tiger-esque fist pumps while code golfing at my desk, sometimes even leaping out of my chair to do so.

-- from The golf course looks great, my swing feels good, I like my chances (Part VI)

Not specifically answering your question, but you seem to have become addicted to the competitive aspect of code golf. Though currently retired, I've experienced first-hand how addictive it can become, how you find yourself shaking your fist in fury at someone you don't know, from the other side of the world, who just had the temerity to pass you on the code golf leaderboard! :)

BTW, tybalt89, who answered your post with the 44 character solution, is mentioned in some of the links below and is one of the all-time golfing greats, and yes he is on the other side of the world to me, and yes he used to regularly pass me on the Perl golf leaderboard ... though I didn't shake my fist in fury at him because I knew how good he was and expected it; I shook my fist most often at `/anick, who I expected to beat, but sometimes didn't.

If you are eager to improve your golfing skills (as opposed to getting others to solve the problem for you) you could learn from the vast amount of prior art in code golf, for example by reading and understanding the many solutions described in the code golf nodes below:

Some Perl Monk Golfers

See Also

Many references were added long after the original reply was made