#!/usr/bin/perl -w use strict; use IO::Select; use IO::Handle; my $selector; my @ready; my $fh; my $line; open(A,"tail -0f file.1 2>&1 |"); A->autoflush(1); open(B,"tail -0f ~/Quake2/baseq2/qconsole.log 2>&1 |"); B->autoflush(1); $selector = IO::Select->new(); $selector->add(*A,*B); while(@ready = $selector->can_read) { foreach $fh (@ready) { $line = <$fh>; if(fileno($fh) == fileno(A)) { print $line; } else { print $line; } } } close(B); close(A);