in reply to Re^2: How can I write Test::Finished?
in thread How can I write Test::Finished?

untested code:
if (open CHILD, "-|") { while (<CHILD>) { if (/^SUPERSECRETSTRING\n/) { exit 0; } print; } close CHILD; # to update $? exit $? >> 8; # oops, child exits, so we do too } ... rest of tests here ... print "SUPERSECRETSTRING\n"; # probably as an END block or DESTROY met +hod

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^4: How can I write Test::Finished? (!END)
by tye (Sage) on Jun 21, 2004 at 20:02 UTC

    Also, since you control both parent and child, you could generate a random 'secret' string.

    # probably as an END block or DESTROY method

    The point is to not put that in an END block or DESTROY method so that it only gets printed when the tests run to completion.

    - tye        

Re^4: How can I write Test::Finished?
by adrianh (Chancellor) on Jun 21, 2004 at 21:40 UTC
    ++. Sneaky.