{ local $/; open my $first_child, '-|', $cmd and $lines = <$first_child>; or do { # forky stuff } }