<?xml version="1.0" encoding="windows-1252"?>
<node id="363199" title="Bottle Golf" created="2004-06-10 17:07:37" updated="2005-08-13 07:16:00">
<type id="115">
perlquestion</type>
<author id="277103">
inman</author>
<data>
<field name="doctext">
Probably done before. Generate the rhyme '10 green bottles...'
&lt;code&gt;
#! /usr/bin/perl -w

foreach (reverse 1..10){
sub wall {$a=$_-1?'s':'';"$_ green bottle$a, standing on a wall\n"}
print wall($_)x2,
"and if 1 green bottle should accidentally fall\nthere'll be ",
wall(--$_),"\n"}
&lt;/code&gt;
Any other methods?</field>
</data>
</node>
