Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Basic programming question

by merlyn (Sage)
on Jan 27, 2005 at 13:01 UTC ( #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? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2022-12-06 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?