#!/usr/local/bin/perl -w use strict; use IO::File; my $count = 0; my @fdesc = (); my %fdname; # create pipes foreach my $prog (@ARGV) { my $fh = IO::File->new("$prog |"); push(@fdesc, $fh); $fdname{$fh} = $prog; } # listen my $notDone=0; do { $notDone=0; foreach my $fh (@fdesc) { if (!$fh->eof()) { $notDone=1; print "<",$fdname{$fh},">: ",$fh->getline(); } } } while ($notDone);