On Windows, I want to execute something only when the script dies. The block below did not help; I think this is because Windows does not support signals.
$SIG{__DIE__} = sub {
qx(taskkill /F /IM telnet.exe);
CORE::die @_;
}
Then I tried this:
END {
qx(taskkill /F /IM telnet.exe);
exit $exit_code;
}
He completed taskkill, but exited with a completion code of 0. I need to deploy exit_code, as we do further processing based on it.
source
share