title: Perl HTTP POST request with Content type and Authorization token
body: <p>I need to send an HTTP POST request with the following HTTP headers:</p>
  
  <pre><code>Content-type: 'application/atom+xml'
  Authorization: MyLogin auth=$token
  </code></pre>
  
  <p>The token is coming from an authorization subroutine. Here is the Perl making the actual request after the subroutine is successful:</p>
  
  <pre><code>my  $ua = LWP::UserAgent-&gt;new;
  my  $req = $ua-&gt;post ( $url );
      $req = header('Content-type' =&gt; 'application/atom+xml');
      $req = header('Authorization' =&gt; "MyLogin auth=$token");
  </code></pre>
  
  <p>However, I receive the following error when run:</p>
  
  <pre><code>Undefined subroutine &amp;main::header called ...
  </code></pre>
  
  <p>How can I accomplish this?</p>