Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl file execution control 2

Status
Not open for further replies.

carlosAlberto

IS-IT--Management
Oct 9, 2001
109
GB
Hi all,

I'm fairly new to perl so i may be asking a simple question but here goes:

I have a perl file (file1) which during execution calls file2. As i understand it, once finished executing file2, control is passed back to file1.

Is there a method where control is NOT passed back to file1 after file2 has finished execution???? When file 1 reference file2 total control is passed over.


Thanks,

Carl.
 
Yes.

Use the exec() function to run perl script, or any other process, and not return to the calling process. Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Mike,

Thanks for your input.

Does exec() terminate the parent process also????


Carl.
 
It does yes, in fact exec() means "replace the currently running process with this one..."

Do you need the parent process to continue without waiting for the child? Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Thanks,

exec() is the function that i'm looking for.

Although, how is it possible to keep the parent process also for future reference???

Mike, you may be able answer another of my queries:
I would like to perform a unix system() function call, how do i store/display the results of the call?

Thanks again,

Carl.
 
You can use backticks (`) to store the results of a system call (in whatever OS you are using). Here is an example:

$date = `date`;
print $date;
 
yep Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top