using the system function

When using the system function is there
a way not to completely exit the
program when the call is made. I want program control to be returned to the next line of the function in which the system call was made.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

As you ask the question, that is exactly what does happen.  The system() creates a new process that does the requested operation and waits for it to complete and then when the function is complete the statement following the system() is executed.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
If what you really mean is that you want to continue while the system() invoked thing processes, then do system("your request &"); assuming that we are taliking unix/linux here.

The & causes the function to be invoked as a background task, and the directly invoked process will exit and return control to you.
Or you might do an explicit fork yourself. (if that's what you really mean)
fork would be better.  My method essentially does a fork() but by using the shell to do it for you.  I allowed myself to be misled by the request wording.  The only thing that I do not like about fork compared to my method is that on some web servers there will then be two perl interpretters running when one was created only to run the non-perlcommand, whatever it is,  And, you need to understand a little more about process ids to understand what is going on in a fork.
admiralAuthor Commented:
Thanks for all your help !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.