#!/usr/bin/perl use strict; use warnings; $| = 1; open( my $fh,"./test |") or die "Error, cannot start command: $!"; while ( my $line = <$fh> ) { print $line; }