Can you please explain how $target variable is evaluated and on what the map function is applied ?
... = map { 1+ index( $_->[0] // '', $0 ) && $_->[1] != $$ ? $_->[1] : () } ...
Which tests if the first value in the anonymous array ($_->[0]) contains $0 (the name&path of the current program), and if the second value in the anonymous array ($_->[1]) (the process id) is not equal to $$ (the process id of the current perl program),
then it passes that second value (the pid) out of the map
otherwise it returns nothing.
I am getting syntax error
What is the text of the syntax error? What version of perl are you running?
In reply to Re^3: Kill a perl script execution in windows
by BrowserUk
in thread Kill a perl script execution in windows
by rbala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |