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

From the good book

by awwaiid (Friar)
on Jul 15, 2000 at 12:02 UTC ( #22686=poem: print w/replies, xml ) Need Help??

"After three days without programming, life becomes meaningless." - The Tao of Programming

undef $life if ((time-3*24*60) > $last_programmed);


Replies are listed 'Best First'.
RE: From the good book
by Anonymous Monk on Oct 02, 2000 at 08:05 UTC
    would this work out better as undef $life if ($last_programmed > (time-3*24*60) );
      You forgot a 60...
      undef $life if ($last_programmed > (time-60*60*24*3) );
        oops. thanks.

        Actually I was thinking that $last_programmed was unix-time for when one last programmed. Soif you subtract 3 days (60*60*24*3 seconds) from the current time, you get three days ago. If three days ago is more than $last_programmed, then it is time to undef self.

        But I did forget the 60

        If you wanted to consider $last_programmed as the amount of time since you last programmed (in seconds) however, than you don't have to subtract 3 days from the current time, you can just do a direct comparison to three days.

        Okay, I'll go away now.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: poem [id://22686]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2021-10-24 09:59 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (89 votes). Check out past polls.