in reply to Re: Execute progams in parallel
in thread Execute progams in parallel
I'm interested in getting the PID of the commands, but program is printing the PID's after completion of the program we've executed from Proc::background.
I'm working on Windows and when I check my Task Manager for all the processes, It is showing perl.exe processes but not my Perl programs.Any alternative to check if the program CreatePerson.pl or CreateCountry.pl are running or not.
#!/usr/bin/perl use strict; use warnings; use Proc::Background; use Config; my $secure_perl_path = $Config{perlpath}; if ($^O ne 'VMS') {$secure_perl_path .= $Config{_exe} unless $secure_perl_path =~ m/$Config{_exe}$/i }; my $command1 = "$secure_perl_path $ENV{'source'}/src/CreatePerson.pl"; my $command2 = "$secure_perl_path $ENV{'source'}/src/CreateCountry.pl" +; foreach ( $command1, $command2 ) { my $proc = Proc::Background->new("$_ &"); print $proc->pid(),"\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Execute progams in parallel
by molecules (Monk) on Jan 20, 2010 at 16:36 UTC | |
by kalyanrajsista (Scribe) on Jan 25, 2010 at 12:11 UTC | |
by molecules (Monk) on Jan 25, 2010 at 15:25 UTC |