in reply to How to reuse a http::request object?

Don’t do that. It’s not sensible, ulimately, and there are ways to do what you want.

You probably want default_header(s) in LWP::UserAgent (and WWW::Mechanize is a nicer subclass of it). If you want better HTTP::Request shortcuts, try HTTP::Request::Common

use strictures; use LWP::UserAgent; # my ($content,$decoded,$req,$res); # ^^^ No! Nothing in the full scope, please. my $ua = LWP::UserAgent->new; $ua->default_header('Content-Type' => 'application/json'); $ua->default_header('Accept' => 'application/json, text/javascript, */ +*; q=0.01'); while ( my $url = your_url_generator_lister() ) { my $response = $ua->get($url); # do whatcha gonna do with it. }