if (open RESULTS, "-|") { # I am the original process, so read from below } else { # I am the kid if (open STDIN, "|-") { # I am still the kid, but my STDIN is now piped from the grandkid exec "your", "big", "application"; die "can't find big application: $!"; } else { # I am the grandkid: be a data pump print "$_\n" for @input_data; exit 0; } } while () { .... }