use LWP::UserAgent qw( ); my $response = LWP::UserAgent->new()->get('http://www.w3.org/html'); for (;;) { my $uri = $response->request()->uri(); my $status = $response->status_line(); print("$uri => $status\n"); $response = $response->previous(); last if !defined($response); print("as a result of\n"); }