in reply to How can I timestamp each printed statement?

Initialize..
my $now = sub (return scalar(localtime time)); # Creates a subroutin +e reference
Use as:
print $now->(), .... # Makes a call to the sub, each time $now->() +is used

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom