Iam new to Perl on Windows and hence landed up here. I need to run du command in the background within the perl script on windows which takes some 5mins. Also i need to capture the output of this command to a file. I searched many forums and could understand Proc::Background suits the best. But iam not sure how to capture the output. Below is the thing i tried.
use Proc::Background; my $cmd="du(qw//usr/bin//); my $proc=Proc::Background->new($cmd); my $alive=$proc->alive; my $pid=$proc->pid; print "pid is $pid\n";
Now iam struck how to capture output of the du cmd.Please suggest.
In reply to running a cmd in background and capturing the output by PBeginner
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |