Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Interestingly, you can assign to $^T...
I've tested this in Perl 5.6.2, 5.8.9, and 5.20.0 with the same results. However, $^T is quite magic. You can assign a floating point number to it, but it will be rounded to an integer:
What's happening there? Well, the floating point number is actually stored correctly in Perl's SV structure. However any fetch will just get the integer instead.
So even if you wrote a module to capture a more precise time, it couldn't be stored in $^T because that scalar is too magic.
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
In reply to Re: Higher resolution $^T?
by tobyink
|
|