develooper Front page | perl.fwp | Postings from May 2003

Re: 99 bottles of beer on the wall

Thread Previous | Thread Next
From:
fun_with_perl
Date:
May 25, 2003 05:34
Subject:
Re: 99 bottles of beer on the wall
Message ID:
baqd93$1io$3@post.home.lunix
In article <baqckp$1io$2@post.home.lunix>,
	fun_with_perl@ton.iguana.be (Ton Hospel) writes:
> In article <baqcdl$1io$1@quasar.home.lunix>,
> 	ton@quasar.home.lunix (Ton Hospel) writes:
>> In article <20030525050307.GB4855@linguist.thayer.dartmouth.edu>,
>> 	Ronald J Kimball <rjk@linguist.Thayer.dartmouth.edu> writes:
>>> On Sun, May 25, 2003 at 02:57:48PM +1000, Andrew Savige wrote:
>>>> As you might expect, I cannot resist re-opening this golf game,
>>>> after a half-time break of four and a half years:
>>> 
>>> Then please consider my more recent version...  :)
>>> 
>>> $n=pop||99;sub b{"$n bottle@{[$n!=1&&s=>]} of beer"}print$b=b,$w=' on the wall',
>>> ",\n$b,\nTake one down, pass it around,\n",b($n--),"$w.\n"while$n
>>> 
>>> Ronald
>> 
>> sub b{"$n bottle"."s"x!!-~$n." of beer"}
> oops, should be sub b{"$n bottle"."s"x!! ~-$n." of beer"} of course, and
> that doesn't gain anymore :-(
So let's go for the bigger picture instead then:
$n=pop||99;sub b{"$n bottle"."s"x!!--$n." of beer"}print$b=b,$w=" on the wall",",\n$b,\nTake one down, pass it around,\n",b,"$w.\n"while++$n

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About