TIMTOWTDI --
#! perl -slw use strict; use threads qw[ async ]; use Thread::Queue; my @dnss = qw( 111.111.111.111 222.222.222.222 111.222.111.222 222.111.222.111 ); my $Q = new Thread::Queue; my $host = $ARGV[ 0 ]; my $count : shared = @dnss; async{ $Q->enqueue( qx[ nslookup -type=A $host $_ 2>nul ] ); $count--; } for @dnss; sleep 1 while $count; ## Do something with results print $Q->dequeue while $Q->pending;
In reply to Re: Parallel DNS queries (use threads; )
by BrowserUk
in thread Parallel DNS queries -- please comment on code
by Tomte
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |