Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: 99 bottles of beer on the Wall

by Abigail-II (Bishop)
on Aug 21, 2002 at 13:11 UTC ( #191720=note: print w/ replies, xml ) Need Help??


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

And here's a different way:

#!/usr/bin/perl use strict; use warnings 'all'; use Lingua::EN::Inflect; my $beer = abs (shift || 99); sub UNIVERSAL::TIEHASH {bless [] => shift} sub UNIVERSAL::FETCH {no strict 'refs'; &{"Lingua::EN::Inflect::" . ref $_ [0]} (split /$;/ => $_ [ +1])} tie my %N => 'NUMWORDS'; tie my %B => 'PL'; print <<"--" while $beer; \u$N{$beer} $B{bottle => $beer} of beer on the wall, $N{$beer} $B{bottle => $beer --} of beer. Take one down, pass it around. \u$N{$beer} $B{bottle => $beer} of beer on the wall. -- package NUMWORDS; package PL; __END__


Comment on Re: 99 bottles of beer on the Wall
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://191720]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2015-07-29 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (268 votes), past polls