Perl-Sensitive Sunglasses PerlMonks

### Comment on

 Need Help??

Despite being shocked that Jasper and I had totally different 101 stroke solutions to the Saving Time challenge, I had a feeling that Rhebus and I would have similar solutions to this one. There just seemed to be much less scope for magic formulae and general weirdness in the beer bottle game. I've contacted Rhebus and am pleased to report that he was as curious as I was and happy to compare our solutions in the hope of unearthing an even shorter one. Here is his 162 stroke winning entry:

@a=(++$a." bottle$& of beer",on,the,wall),s/^/
Take one down and pass it around, @a.

@a, $a[0]./,/s/until/ 99/;print"99$'
Go to the store and buy some more, @a."
[download]

If you compare his with mine:

/s/until@c=(@b=(++$n,bottle.$&,of,beer),on,the,wall),s/^/Take one down
+ and pass it around, @c.

@c, @b.
/,/, 99.*

/;print$'."Go to the store and buy some more$&"
[download]
you'll see some similarities and some differences. The major difference is that Rhebus used a five stroke shorter terminating regex, namely /\n99/ instead of my /, 99.*\n\n/, that unfortunately cost five strokes elsewhere: two strokes for the extra 99 at the front of the printed string and three for the terminating , @a. (instead of \$&) at its end.

Can these two solutions be combined somehow to produce a shorter one? I can assure you that many variations are possible but I couldn't find any reductions. So if you can further shorten it, you can claim to be the inventor of the shortest solution to the most popular golf game of all. :)

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.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, 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: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
 [thezip]: Is there an analogy for '&' (ie. run commandline process in background) for Windows commandline? [Corion]: thezip: start "some title" path\to\that\ application, but that will open another console window [Corion]: thezip: If you want to confuse your users, use system(1, "that\\command" );, which will make Perl launch it in the background [Corion]: That will keep the console window open even though the user can't type into it anymore [thezip]: So I have a script that generates a log file. After script completion, I want tohave VIM open this logfile.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2017-03-27 18:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should Pluto Get Its Planethood Back?

Results (321 votes). Check out past polls.