CPANPLUS

 view release on metacpan or  search on metacpan

inc/bundle/IPC/Cmd.pm  view on Meta::CPAN

758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
  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 )