Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Killing a child process

by Anonymous Monk
on Oct 03, 2017 at 08:34 UTC ( [id://1200594]=note: print w/replies, xml ) Need Help??


in reply to Killing a child process

The corrected code snippet, with the usual thanks to all commenters.

#!/usr/bin/perl use strict; use diagnostics; use warnings; my $pid = fork || exec 'play', '/home/ra/Desktop/trek2.mp3'; print "My PID is *$pid*\n"; sleep 5; kill 'KILL', $pid;

Replies are listed 'Best First'.
Re^2: Killing a child process
by ikegami (Patriarch) on Oct 03, 2017 at 15:37 UTC

    The approach recommended above is actually the less violent

    kill INT => $pid;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found