in reply to A value that stays a value (for some time)

You may be looking for Tie::Scalar::Timeout. If you really do want a subroutine to be returning the value you could build a closure around the sub, and declare the tied variable into the broader-scope of the closure. It can be tied within the sub, as needed.


Dave

  • Comment on Re: A value that stays a value (for some time)

Replies are listed 'Best First'.
Re^2: A value that stays a value (for some time)
by freakingwildchild (Scribe) on Jun 18, 2006 at 17:31 UTC
    this is for mod_perl ;

    I'm using normal cgi sessions. It can also be used for a added security to downloaders ; because the path changes as soon as the ip / user / "token" or "ticket" expires.

    I'd need such thing as this, but based on a formula of information including an expiration value ; which is now set to 900 currently (15 minutes).

    The problem is, since there is no mod_perl:

    1. I have no statefull connection
    2. hereby the system will have to "guess" it by itself and do the appropriate addings/encrypting and powdering afterwards.
    3. it introduces a "five-before-twelve" bug which means; if you are 1 minute before the expiration timeframe of 900 seconds ends,
      • you either have to be fast entering your password and bark like a dog 3 times or
      • have the inconvience of seriously discomforted/discombulated electrons; because "your logintime just ended" ... awwww
      this is for mod_perl
      Don't count on it! Even in mod_perl you are never guaranteed that your request will be handled by the same worker/thread as before.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      this is for mod_perl ;

      Why didn't you say so in the first place... didn't seem relevant at the time?


      Dave