in reply to How can I timestamp each printed statement?
Update: You can get the effect you want — having $now implicitly call localtime — by tie-ing it:
It's probably not what you really want to do, though.package Now; require Tie::Scalar; our @ISA = qw(Tie::StdScalar); sub FETCH {scalar localtime} package main; tie my $now, 'Now'; print "The time is $now\n"; sleep 3; print "The time is $now\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I timestamp each printed statement?
by johnnybongo (Initiate) on Mar 06, 2008 at 19:43 UTC |