rohana wrote at Wed, 24 Jul 2002 08:57:17 +0200:
> I want to execute same perl procedure with different parameters at the almost same
>time in a perl
> program indefendantly. (next process should be started without waiting for the end
>of previous
> one) The procedure is located in .pm file. How can I use thread in perl to get my
>work done?
It's easy when you have perl 5.8.0 installed.
Then a simple
perldoc threads
will help you.
E.g.
use threads;
$| = 1;
threads->create(sub {while (1) { print "1"; sleep 1 } });
threads->create(sub {while (1) { print "2"; sleep 1 } });
while ("don't stop the main loop") {
sleep (1);
}
shows behaviour of threads.
Best Wishes,
Janek
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]