Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: How to portably stop processes?

by harangzsolt33 (Chaplain)
on Apr 01, 2023 at 00:51 UTC ( [id://11151402]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to portably stop processes?
in thread How to portably stop processes?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^4: How to portably stop processes?
by haj (Vicar) on Apr 01, 2023 at 12:43 UTC
    All right, create a sub called "KillProc()" and then put an if statement in that sub. Execute block A if it's Linux, or execute block B if it's Windows. Portable. Done!

    Why should I bother? I already have a satisfactory solution with Proc::Background, and I wrote that I am happy with it. It's that simple. Why should I even consider to write the same logic myself?

Re^4: How to portably stop processes?
by LanX (Saint) on Apr 01, 2023 at 01:33 UTC
    > It's that simple!

    Brilliant and now please show us working code where taskkill can handle an ID you get from fork ...

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

    PS: yes, I downvoted you now.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11151402]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found