Filehandle fun.

Elthek on 2002-06-29T19:17:15

void:chris~ % perl -e 'use IO::Timestamp::STDERR; print STDERR "pony!\n"' [Sat Jun 29 20:08:58 2002]: pony!

void:chris~ % perl -e 'use IO::Timestamp; tie *FD, 'IO::Timestamp'; print FD "pony!\n"' [Sat Jun 29 20:08:40 2002]: pony!

Well, I'm sure someone somewhere will find it useful, especially with PerlModule inside Apache. If this is you, let me know and I'll do the PAUSE thing. Maybe. I'd rather have hidden the ties and had 'use IO::Timestamp *FD;', but there's perl brokenness when throwing tied FDs around and I don't think it can be done. Living with richardc has its advantages, in that he offered to get Devel::Caller to be able to resolve the filehandles and allow the tie to go through to them. People who understand opcode mangling plus-plus.

I start at MSDW on Monday. I've less than two days of non-suitdom left.


IO::Timestamp::STDERR

TorgoX on 2002-06-29T22:50:02

That's pretty zippy! I like it!

Ya know, one thing I came up with recently that maybe you could work into a related class is: emitting a timestamp only if time() is the different from the time() that it was when the last event was logged. It makes the log files much more readably concise. Try it, you'll like it!