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


in reply to (jeffa) Re: 99 bottles of beer on the Wall
in thread 99 bottles of beer on the Wall

Getting rid of the warning and making it just a little bit prettier:
#!/usr/bin/perl -w use strict; use Lingua::EN::Nums2Words; my $beer = shift || 99; $beer = abs($beer); print how_many($beer), ",\n", how_many($beer), ".\n", "Take one down, pass it around,\n", how_many(--$beer), ".\n\n" while $beer; sub how_many { my $numb = &num2word(shift); $numb =~ s/(\w)(.*)/\u$1\L$2/; return $numb . ' bottle' . ($numb eq 'One' ? '' : 's') . ' of beer on the wall' ; }
Requires Lingua::EN::Nums2Words.
()-()
 \"/
  `