0: package FirstGoodURL;
1:
2: use LWP::UserAgent;
3: use strict;
4: use vars qw( $VERSION );
5:
6: $VERSION = '1.00';
7:
8: my $ua = new LWP::UserAgent;
9:
10: sub find {
11: my ($class,@URLs) = @_;
12: my $req;
13: for (@URLs) {
14: return $_ if $ua->request
15: (new HTTP::Request HEAD => $_)->code == 200;
16: }
17: }
18:
19: 1;
20:
21: # go to http://www.pobox.com/~japhy/modules/
22: # for the module and its docs In reply to FirstGoodURL.pm by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |