my $output; open PROG, "|my_command -v" or die "canīt exec my_command \n"; while ( ){ $output .= $_; }