in reply to Re^4: how to kill background process when script exit?
in thread how to kill background process when script exit?

Sorry, but you are mistaken.
$ perl -E' say "".localtime; open my $fh, q{perl -e sleep |}; say "".localtime; ' Sun Feb 20 13:25:05 2011 Sun Feb 20 13:25:05 2011 [hung waiting for child to exit]

or how about

$ perl -E' open my $fh, q{perl -E'\''sleep 1; say STDERR "C"'\'' |}; say "P"; ' P C

Replies are listed 'Best First'.
Re^6: how to kill background process when script exit?
by Allasso (Monk) on Feb 20, 2011 at 23:55 UTC
    interesting...I agree with you (see my last reply to Corion), but when I run your second script I get this (no fooling):
    perl -e ' open my $fh, q{perl -e '\''sleep 1; print STDERR "C"'\'' |}; print "P"; ' CP
    (I couldn't use 'say', you must have a later version of perl than I?)

      say was introduced 4 years ago in 5.10.

      Buffering is delaying when you see the output.