Hi folks, a question: I've been thinking about the TV series LOST, and the famous countdown timer (reset whenever someone did something to reset the countdown to the beginning). I was wondering about this for storing some transient data in an array of some kind for non-nefarious purposes, of course. :-)
The data, let's say of the format:
"first name", "last name", "time first entered/renewed"
Where "time first entered/renewed" is the last recorded activity of a person, say in UNIX time (seconds since Jan 1, 1970). Now let's say that a program has created this record and gives the user a expiry of 600 seconds. If there's no activity, remove the entry. If there's activity, reset the timer back to 600s. If there's a new user, create the record and set the countdown on.
Now, how would one do this if there were multiple records of users that were last active at various times? Also, how would one display this info (either interactively or in a dump of the array to file every 30 seconds?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.