Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: (jeffa) Re: 99 bottles of beer on the Wall

by mystik (Sexton)
on Aug 21, 2002 at 12:33 UTC ( #191707=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

I'm pretty sure that you need to change how_many($beer--) to how_many(--$beer). After you take one down, and pass it around, unless your vision is blurrey, there's one fewer beer.

For the benefit of those that don't know, $var-- returns the value of $var, then decrements it. --$var first decrements, then returns $var

If the eval engine in my brain is correct, --$var++ will return $var - 1, but the value of $var will still be the same ;)

  • Comment on Re: (jeffa) Re: 99 bottles of beer on the Wall

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://191707]
[choroba]: but I'm not sure it's worth my time...
NodeReaper shudders
[Corion]: choroba: That chart is frustrating as it pits cold hard numbers against puttering around with an annoying problem :)
[choroba]: I only use it when I want to avoid a task...
[Corion]: choroboa: A good choice! ;)

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-07-27 09:20 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (407 votes). Check out past polls.