CPANPLUS
view release on metacpan or search on metacpan
inc/bundle/IPC/Cmd.pm view on Meta::CPAN
758759760761762763764765766767768769770771772773774775776777778
my
$r
= run_forked(
"some external command"
, {
'wait_loop_callback'
=>
sub
{
if
(condition) {
kill
(1, $$);
}
},
'terminate_on_signal'
=>
'HUP'
,
});
Combined
with
C<stdout_handler> and C<stderr_handler> allows terminating
external command based on its output. Could also be used as a timer
without engaging
with
L<
alarm
> (signals).
Remember that this code could be called every millisecond (depending
on the output which external command generates), so
try
to make it
as lightweight as possible.
=item C<discard_output>
Discards the buffering of the standard output and standard errors for return by run_forked().
With this option you have to use the std*_handlers to read what the command outputs.
( run in 0.468 second using v1.01-cache-2.11-cpan-bb97c1e446a )