Skip to content

Instantly share code, notes, and snippets.

Created November 6, 2010 15:38
What would you like to do?
#!perl -w
# usage: [urls...]
use strict;
use Coro;
use Coro::Select; # この行をコメントアウトすると多重化されなくなり時間がかかるようになる
use Furl;
my @coros;
foreach my $url(@ARGV) {
push @coros, async {
print "fetching $url\n";
my $furl = Furl->new();
my $res = $furl->head($url);
print "$url: ", $res->status_line, "\n";
$_->join for @coros;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment