my ($status, $content, $type, $base, $length) = get_page($site); print $length, " bytes\n"; #################################################### sub get_page { my ($site, $pi) = @_; $browser = LWP::UserAgent->new() unless $browser; my $response = $browser->get($site); my $status = $response->status_line; my $content = $response->content; my $type = $response->content_type; my $base = $response->base; my $length = commify(length($content)); if (!$response->is_success) { die "\nError: $status ($site)\n"; } return $status, $content, $type, $base, $length; }