#!/usr/bin/perl open my $foo, "yes | ./foo.pl |" or die $!; while (<$foo>) { print ": $_"; }