Problem with thread
[email protected] (Ollivier Cédric)
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <[email protected]> |
Hello
I have a problem with my program. I would like to do some instructions in the same time by using thread.
Why can I do for creating multithread in Perl ?
That's my program.
use threads;
use Config;
use Net::Ping;
$Config{useithreads} or die
"Recompilez Perl avec les threads activés pour faire tourner ce programme.";
sub subping {
my ($c) = @_;
$p = Net::Ping->new();
if ($p->ping($c)) {
print "$host is alive.\n";
}
else {
print "$host is not alive";
}
$p->close();
}
for ($i=1;$i<255;$i++)
{
$host="10.10.10."."$i";
my $thread = threads->create(threads,subping($host));
}
print "c'est terminé";
That's be very nice to help me.
PS I'm sorry but I'm French and I don't speak very well English
---------------------------------
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail
Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !