Hello list,
Could any one tell me a nice tutorial to learn about fork()ing in perl.

I want to accomplish following task with fork function. But i am not
sure this can be done with fork()?

I have a lengthy Perl script running on a 4 processor machine. At one
point of time i have to execute four shell commands / mysql quries from
four different batch files. Currently i run them one after other. Can i
use fork at this place so that i can fire all 4 mysql quries
simultaneously and collect the results back to main process.

portion of script follows ...
#!/usr/bin/perl
.............
...........
$var1=`mysql -h localhost -u xx -pyy filter < batchfile1.sql |tail -1`;
$var2=`mysql -h localhost -u xx -pyy filter < batchfile2.sql |tail -1`;
$var3=`mysql -h localhost -u xx -pyy filter < batchfile3.sql |tail -1`;
$var4=`mysql -h localhost -u xx -pyy filter < batchfile4.sql |tail -1`;

$total=$var1+$var2+$var3+$var4;

NOTE : I dont want to use Perl-DBI.

Many thanks in advance....
-- 
Ra. Gowthaman,
Graduate Student,
Bioinformatics Lab,
Malaria Research Group,
ICGEB , New Delhi.
INDIA

Phone: 91-9811261804
       91-11-26173184; 91-11-26189360 #extn 314


-- 
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