#! perl -slw use strict; use threads; use LWP::Simple; my $start = time; my @threads; while( <> ) { chomp; push @threads, async{ eval { local $SIG{ ALRM } = sub { die 'timeout' }; alarm 10; my( $content_type, $document_length, $modified_time, $expires, $server ) = head( "http://$_" ) or warn "Failed to HEAD $_: $!\n"; }; }; } $_->join for @threads; printf "\nRunning HEAD on $. urls using threading took %d seconds\n", time() - $start; __END__ C:\test>junk58 urls.list.small Failed to HEAD www.asuscom.de: Failed to HEAD www.belkin.com: Failed to HEAD www.logical-approach.com: Running HEAD on 100 urls using threading took 19 seconds