Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: 99 Bottles Of Beer (can't we do better)

by screamingeagle (Curate)
on Feb 20, 2002 at 05:25 UTC ( #146505=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $nBottles = ($ARGV[0] > 0) ? $ARGV[0] :100;
    foreach (reverse(1 .. $nBottles)) {
    ...
    
    
    
  2. or download this
    $nBottles = ($ARGV[0] > 0) ? $ARGV[0] :100;
    foreach (reverse(1 .. $nBottles)) {
    print "\n$_ bottle",($_ == (1 || 2)) ? "" : "s"," of beer on the wall,
    +\n$_ bottle",($_ == (1 || 2)) ? "" : "s"," of beer,\nTake one down, p
    +ass it around,\n" , ($_ - 1)," bottle",(($_ - 1) == 1) ? " " : "s ","
    + of beer on the wall\n";}print "\n*burp*\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2014-12-18 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (43 votes), past polls