use Modern::Perl; use IO::Pipe; my $pipe = IO::Pipe->new; $pipe->reader(qw(echo foo > bar)); while (<$pipe>){ print; }