timestamp in STDERR output

Matt Lawrence matt.lawrence at virgin.net
Fri Jun 30 11:43:30 BST 2006

> Hi Ben,
>>I'm trying to understand perl a little better here!
>>could you explain why you use untie here having used the typeglob to
>>make the STDERR filehandle local to the block?
> I must admit I don't get it either as
> use Tie::STDERR \&timestamper;
> sub timestamper {
>     print time().': '.shift;
> }
> print STDERR "bla\n";
> works fine for me.

Ah yes, the original code printed to STDOUT, which might not be what you
really want.

Dave posted an addendum later that would (should) break the above code.


More information about the london.pm mailing list