title: How to set User-Agent with LWP?
body: <p>I have the Perl &amp; LWP book, but how do I set the user-agent string?</p>
  
  <p>This is what I've got:</p>
  
  <pre><code>use LWP::UserAgent;
  use LWP::Simple; # Used to download files
  
  my $u = URI-&gt;new($url);
  my $response_u = LWP::UserAgent-&gt;new-&gt;get($u);
  die "Error: ", $response_u-&gt;status_line unless $response_u-&gt;is_success;
  </code></pre>
  
  <p>Any suggestions, if I want to use <code>LWP::UserAgent</code> like I do here?</p>