http://internet.ls-la.net/mirrors/99bottles/beer_n_r.html#perl
! /usr/bin/perl # Jim Menard jimm@{bbn,io}.com (617) 873-4326 http://www +.io.com/~jimm/ $nBottles = $ARGV[0]; $nBottles = 100 if $nBottles eq '' || $nBottles < 0; foreach (reverse(1 .. $nBottles)) { $s = ($_ == 1) ? "" : "s"; $oneLessS = ($_ == 2) ? "" : "s"; print "\n$_ bottle$s of beer on the wall,\n"; print "$_ bottle$s of beer,\n"; print "Take one down, pass it around,\n"; print $_ - 1, " bottle$oneLessS of beer on the wall\n"; } print "\n*burp*\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: 99 Bottles Of Beer (can't we do better)
by mojotoad (Monsignor) on Feb 20, 2002 at 06:05 UTC | |
Re: 99 Bottles Of Beer (can't we do better)
by screamingeagle (Curate) on Feb 20, 2002 at 05:25 UTC | |
Re: 99 Bottles Of Beer (can't we do better)
by particle (Vicar) on Feb 20, 2002 at 09:04 UTC | |
Re: 99 Bottles Of Beer (can't we do better)
by jmcnamara (Monsignor) on Feb 20, 2002 at 08:29 UTC | |
by blakem (Monsignor) on Feb 20, 2002 at 08:49 UTC | |
Re: 99 Bottles Of Beer (can't we do better)
by runrig (Abbot) on Feb 20, 2002 at 05:20 UTC |