<?xml version="1.0" encoding="windows-1252"?>
<node id="146498" title="99 Bottles Of Beer (can't we do better)" created="2002-02-20 00:02:00" updated="2005-08-13 08:32:24">
<type id="120">
perlmeditation</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
99 Bottles Of Beer (can't we do better)
&lt;P&gt;
[http://internet.ls-la.net/mirrors/99bottles/beer_n_r.html#perl]
&lt;code&gt;
! /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 &lt; 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";
&lt;/CODE&gt;</field>
<field name="reputation">
17</field>
</data>
</node>
