in reply to Re: "- |" pipe option doesn't work
in thread "- |" pipe option doesn't work

Thanks for confirmation

Replies are listed 'Best First'.
Re^3: "- |" pipe option doesn't work
by Corion (Patriarch) on Jan 09, 2017 at 15:34 UTC

    I don't see in your code why you would need a self-pipe+fork.

    For reading from an asynchronous process, I've used a plain pipe-open quite successfully:

    my $cmd = 'sdb shell hcidump |'; my $child = open( my $hci, $cmd ) or die "Couldn't spawn [$cmd]: $!"; while (<$hci>) { ... }; END { if( $child ) { kill 'KILL' => $child; }; $child = 0; };

    Update: There was the pipe missing from the command line, whoops!