If you are using a unix system, the fork function may help you.

-----Original Message-----
From: Tielman Koekemoer (TNE) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 24, 2005 6:14 AM
To: Perl Beginners
Subject: To Thread or not?



Hi all,

I need to execute a shell command in a loop but the shell command
takes about 1 minute to complete. I want to execute the shell command
but but then continue processing. Usually I would "background" the
process with & but this does not work as Perl waits for the process to
exit before returning. Should I be using Thread to do this or is there
another way? 

I can write a shell script which then has the & included but that's
messy and I want to keep it clean.

E.g.

While (1) {

Some processing here..

` execute some shell script/command here`; # takes about 60 seconds to
complete

Would like to start processing as soon as the above command is
executed...

}

TIA!

Tielman Koekemoer
IT Solution Delivery - NFMS
Office: 012-311 4039
Fax:     012-321 5302
Cell:     083-445 0019



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to