Skip to content

Instantly share code, notes, and snippets.

@gfx gfx/fetch.pl
Created Nov 6, 2010

Embed
What would you like to do?
#!perl -w
# usage: fetch.pl [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;
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.