How will you decide when to kill it?
If (say) you only want the first 100 lines of output you might use something like:
my $pid = open CMD, 'program.exe |' or die $!; my @output; push @output, scalar <CMD> for 1 .. 100; kill 9, $pid; ## Do something with @output
In reply to Re: Run and Stop another program in perl
by BrowserUk
in thread Run and Stop another program in perl
by fast
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |