http://www.perlmonks.org?node_id=114483


in reply to Need simple example tying scalar to localtime()

untested, but I think I'll get this right. :)
{ package Tie_timer; sub TIESCALAR { bless {}, shift } sub FETCH { scalar localtime } } tie $now, Tie_timer; print $now;

-- Randal L. Schwartz, Perl hacker