I'm considering finally to register as a CPAN author and uploading this
(followed by other modules that are in the pipeline, waiting for some spare
time). Any comments or suggestions greatly appreciated.
There'll be a Tie::Array::Timeout and Tie::Hash::Timeout as well.
NAME
Tie::Scalar::Timeout - Scalar variables that time out
SYNOPSIS
use Tie::Scalar::Timeout;
tie my $k, 'Tie::Scalar::Timeout', MAXAGE => 2;
$k = 123;
sleep(3);
# $k is now undef
DESCRIPTION
This module allows you to tie a scalar variable whose value will be
reset to undef after a certain time. When tying, you can specify
arguments in the form of a hash. Use `MAXAGE' to specify the number of
seconds after which the value will be reset to zero. (Technically, the
value will still be there, but the module's FETCH sub will return
`undef'.) Using the `VALUE' hash key, you can specify an initial value.
One possible application for this module might be to time out session
variables in mod_perl programs.
AUTHOR
Marcel Grünauer <[EMAIL PROTECTED]>
SEE ALSO
perl(1), Tie::Scalar(3pm).
Marcel
--
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
-- London.pm strategy aka "embrace and extend" aka "mark and sweep"