Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Close script with open system call

by kennethk (Abbot)
on Feb 27, 2020 at 13:10 UTC ( #11113487=note: print w/replies, xml ) Need Help??

in reply to Close script with open system call

As documented in system:
Does exactly the same thing as exec, except that a fork is done first and the parent process waits for the child process to exit.
So, if you don't want to wait for the child process to exit (e.g., someone to close the text editor), change that to an exec. It will change the executing process -- mind body and soul -- to be the running text editor, giving up control forever.

You also can remove the exit in that case, too. Please note that exit is almost never what you actually mean to do if you don't need to return a status code. Just let the script roll off the end.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Close script with open system call
by Phweda (Initiate) on Feb 27, 2020 at 14:37 UTC

    Thanks all exec was what I needed.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2021-10-19 10:19 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (76 votes). Check out past polls.