title: Adding headers to a LWP post in Perl
body: <p>I have taken over some perl code and been asked to add a keep-alive header to the LWP post that happens.</p>
  
  <p>Google tells me how to do this for certain setups, but I can't see how to do it for the way this code has been written. All the info I can find works on the basis of creating the LWP object, then creating the POST and parameters, then adding the headers, then actually POSTING the request, however in the code I have to deal with, the creating of the POST, adding the headers and sending are all in one line:</p>
  
  <pre><code>my $ua = LWP::UserAgent-&gt;new;
  my $response = $ua-&gt;post( $URL, ['parm1'=&gt;'val1']);
  </code></pre>
  
  <p>How/where can I add the headers in this setup, or do I need to re-write as per the examples I have found?</p>