Hello r@j,
Welcome to the Monastery. It seems the fellow Monks have answer your question already but just to add also another possible uni platform (WindowsOS - LinuxOS) oprtion Proc::Background.
Sample of code:
#!/usr/bin/perl use strict; use warnings; use feature 'say'; use Proc::Background; my $command = 'ls'; my $arg1 = '-la'; # Add an option to kill the process with die when the variable is # DETROYed. my $opts = {'die_upon_destroy' => 1}; my $bg = Proc::Background->new($opts, $command, $arg1); my $pid = $bg->pid; say $pid; $bg = undef; __END___ $ perl test.pl 9944
More documentation Review of Proc::Background and similar question to yours process run in background.
Hope this helps, BR.
In reply to Re: get the running status of process without using ps -ef
by thanos1983
in thread get the running status of process without using ps -ef
by r@j
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |