my %pi; my ($status, $content, $type, $base, $length) = get_page(\$site, \%pi); print $pi{'length'}, " bytes\n"; #################################################### sub get_page { my ($site_ref, $pi) = @_; $browser = LWP::UserAgent->new() unless $browser; my $response = $browser->get($$site_ref); 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"; } @{$pi}{qw(status content type base length)} = ($status, $content, $type, $base, $length); }