in reply to Event timing and input processing

I haven't tried POE myself yet, but on following merlyn's link, it looks like something that would be very good to try.

But if, for some odd reason, you wanted to consider some other approach, the next thing I would consider (if I were in your position) would be to create a separate script that fetches and prints log info, with the ability to control source and output format (and perhaps timing as well) based on command-line params, and run that via a pipeline "open()" for each log activity being requested -- something like (untested):

my @loggers; # array of file handles my @logpids; # array of pids for open file handles ... # in branch of case statement for starting a new logger: my $args = "whatever is appropriate..."; my $pid = open( $loggers[@loggers], "logger_script $args |" ) or die "can't run logger_script: $!" ); push @logpids, $pid; ...
The other part of the trick would be to manipulate each file handle (as well as STDIN) to allow for non-blocking i/o, which means that a read will return data if there is any, and will return immediately with no data if there is none available. Check the IO::Handle man page for info on non-blocking i/o (IO::Handle is part of the perl core distro). You may also want to look at the multi-arg usage of the "select" function -- see "perldoc -f select".

The person doing the interaction can request that logs be turned off at any time -- just close the associated file handle to stop the chosen process.