my $pid = open(CHILD, "-|", 'child', @child_args) if ($pid) { while () { $logger->($_) } } close(CHILD);