http://www.perlmonks.org?node_id=348388


in reply to 99 bottles, 2 lines

The problem occurs when you must decide whether to write "bottle" or "bottles". Some replies above do not take this into account despite the original poster doing so. Just for fun, here is my solution (longer than the original though). It is 178 characters long:
($a,$b,$c,$n)=(" bottle"," of beer"," on the wall",99);sub u{$s=$n-1?" +s":();$e="$n$a$s$b"}while($n){u;print"$e$c, $e!\nTake one down, pass +it around,\n";$n--;u;print"$e$c!\n\n"}