in reply to Re: method of ID'ing
in thread method of ID'ing
Hmmm... how about using Time::HiRes to increase precision of $^T (in reasonable cases of course)?!
$^T is set before Time::HiRes can be loaded, so it won't make a difference. $^T is not a magic variable that issues time, it is set when the interpreter starts (which can cause a lot of trouble when running under mod_perl, irssi, or any other long term perl embedder).
Don't use $^T for IDing purposes, use time instead. To update existing scripts (but it might break some that depend on $^T to not change), you could use:
package Tie::Time; use Carp; use strict; sub TIESCALAR { bless \my $dummy, shift } sub STORE { croak 'Cannot set time this way' } sub FETCH { time } =head1 NAME Tie::Time - Have a scalar return the current time() =head1 SYNOPSIS tie my $time, 'Tie::Time'; # New variable tie $^T, 'Tie::Time'; # Override existing $^T =head1 DESCRIPTION Guess :) =head1 URL http://perlmonks.org/?node_id=158912 =cut
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: method of ID'ing
by particle (Vicar) on Apr 14, 2002 at 13:27 UTC | |
by Juerd (Abbot) on Apr 14, 2002 at 13:48 UTC | |
by particle (Vicar) on Apr 14, 2002 at 15:25 UTC | |
|
Re: Re: Re: method of ID'ing
by tmiklas (Hermit) on Apr 14, 2002 at 17:09 UTC |