use IO::Pipe; use warnings; use strict; my $cmd = shift || "pause"; my $pipe = new IO::Pipe; $pipe->reader($cmd); print while (<$pipe>); __END__