How can I gently kill a process in ActiveState Perl?

Do I need to use a specific exit code?

Win32::Process::Create(
    $ProcessObj,
    "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe",
    "firefox -no-remote -P $prof_name",
    0,
    NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();
$ProcessObj->kill(0);

Thus, it kills, but not softly, it creates problems with the Firefox profile.

+4
source share
2 answers

Short Conventional methods other than Window taskkillare powerful. Thanks mob and melpomene .


Win32::Process , Kill KillProcess, . Windows , , , winapi, UNIX. , -, , Kill (. ).

taskkill Windows . , taskkill /? . taskkill on MS technet. , $pid,

my $pid = $ProcessObj->GetProcessID();
system("taskkill /t /pid $pid");

GetProcessID() , . .

Windows . this post . .


Perl Kill Windows. perlport

... kill($sig, $pid) , $pid, $sig.

melpomene .

exitcode, , , .

+5

Perl,

kill -15 (pid)

perl

0

All Articles