Cache::FileCache can make this easy.

# from a CGI script which times users out after an interval require Cache::FileCache; my $cache = new Cache::FileCache({ default_expires_in => '60 minutes', auto_purge_interval => '4 hours', auto_purge_on_set => 1, filemode => 0077, namespace => 'cookies', username => 'www', }) or die "cookie_cache\n"; my $user = $cache->get($browser); # logged-in user or undef if ( defined $user and defined $q->param('_logout') ) { $q->delete('_logout'); $cache->remove($browser); # clear cache print($q->p("You are no longer logged in as $user.")); undef $user; } elsif ( not defined $user and defined (my $try_user = $q->param('_us +er')) ) { $q->delete('_user'); my $try_password = $q->param('_password'); $q->delete('_password'); if ( $try_user =~ /^[a-z]{1,8}$/ and verify($try_user,$try_pas +sword) ) { $user = $try_user; print($q->p("Welcome back $user.")); } else { print($q->p("I'm sorry, that's not right.")); } } if (defined $user) { $cache->set($browser,$user); # reset the timeout # do a logout form } else { # do a login form } ...

to limit the program to running at most once per minute, try and get your entry, if you can it's been less than a minute so notify user and exit, if you can't get your entyr it's been more than a minute so do your stuff and set a new entry. you can do the same for each user and give them 1 run a minute or less than 5 runs per 20 minutes without too much work.


In reply to Re: When does XML get to be too much? by zengargoyle
in thread When does XML get to be too much? by newrisedesigns

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.