Add a paragraph to summarize the motivation for releases since 5.815
[libwww-perl-eserte.git] / t / misc / get-callback
bloba026baa99501c89e99b77ade3260f6ab125d260e
2 $url = shift || "";
3 $url = "http://localhost:8080/$url" unless $url =~ /:/;
5 use LWP::UserAgent;
7 $ua = new LWP::UserAgent;
10 $tot = 0;
12 $res = $ua->request(HTTP::Request->new("GET", $url),
13         \&data);
15 sub data
17     my($data, $response) = @_;
18     my $len = length $data;
19     $tot += $len;
20     print "Got $len bytes";
21     unless ($ct_len) {
22         $ct_len = $response->header("Content-Length");
23     }
24     if ($ct_len) {
25         printf " (%.1f%% done)", $tot/$ct_len*100.0;
26     }
27     print "\n";
30 print $res->as_string;