|
|
| more useful options | |
| PerlMonks |
Re: Boolean counter?by Utilitarian (Priest) |
| on Dec 07, 2009 at 08:06 UTC ( #811443=note: print w/ replies, xml ) | Need Help?? |
|
What you want is not a counter but a toggle, shortened using the ternary operator, but not sure if it's more elegant
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||