develooper Front page | perl.beginners | Postings from March 2002

processing multiple records simultaneously

From:
Vani Murarka
Date:
March 19, 2002 14:53
Subject:
processing multiple records simultaneously
Message ID:
3C980DDD.22251.15E4CB8@localhost
Hi Everyone,

My first post to the list. And I really am new to Perl.

I need to write a script which is always on, and keeps checking a table 
in MySQL for new records. When it finds one, it has to do certain 
processing on it. The script should be able to process multiple records 
simultaneously (and independently) if it finds several new records at 
the same time.

I was thinking of doing this by writing a script which would run as a 
daemon (to keep checking the table for new records) and in the while 
loop of this daemon, if the script finds a new record, I would call 
another script (for processing the record) using exec where I would 
pass the primary key of that record.

My query:
1. Is this the proper way to do it? 
2. When calling exec 'perl process_recs.pl $primarykey' are multiple 
instances of this script process_recs.pl created which would each 
process the record whose primarykey is given to it?
3. Where can I get an example of Proc::Daemon?

Thanks a ton

Vani


_____________________________________________________________
 Vani Murarka                          <vani@manaskriti.com>
 Manaskriti Software Solutions     http://www.manaskriti.com
 Bangalore, India                          Ph: 91-80-5262275

  - Web Development / List Hosting & Consultancy Services -
_____________________________________________________________



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About