1 package HTML::AutoConvert::Run;
5 HTML::AutoConvert::Run - Base class for HTML::AutoConvert plugs that run an external program
10 use IPC::Run qw( run timeout );
13 my( $self, $file ) = ( shift, shift );
14 my $opt = ref($_[0]) ? shift : { @_ };
16 my @program = $self->program;
17 my $program = $program[0];
21 my( $html, $err ) = ( '', '');
22 local($SIG{CHLD}) = sub {};
23 run( [ @program, $file ], \undef, \$html, \$err, timeout($timeout) )
24 or die "$program failed with exit status ". ( $? >> 8 ). ": $err\n";