Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Basic programming question

by merlyn (Sage)
on Jan 27, 2005 at 13:01 UTC ( [id://425543]=note: print w/replies, xml ) Need Help??


in reply to Re: Basic programming question
in thread Basic programming question

($hour %= 12) ||= 12;
I find this to be easier to explain:
$hour = ($hour + 11) % 12 + 1;

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-19 00:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found