use autodie; ... open my $pipe, '-|', $command; while (<$pipe>) { ... }