Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Boolean counter?

by Utilitarian (Vicar)
on Dec 07, 2009 at 08:06 UTC ( #811443=note: print w/ replies, xml ) Need Help??

in reply to Boolean counter?

What you want is not a counter but a toggle, shortened using the ternary operator, but not sure if it's more elegant
Edit...In fact Corion's solution above is way better.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Comment on Re: Boolean counter?
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2015-11-25 16:41 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (683 votes), past polls