title: How can I exclude the part of the string that matches a Perl regular expression?
body: <p>I have to file that has different types of lines. I want to select only those lines that have an user-agent. I know that the line that has this is something like this.</p>
  
  <pre><code>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16
  </code></pre>
  
  <p>So, I want to identify the line that starts with the string "User-Agent", but after that I want to process the rest of the line excluding this string. My question is does Perl store the remaining string in any special variable that I can use to process further? So, basically I want to match the line that starts with that string but after that work on the rest of it excluding that string.</p>
  
  <p>I search for that line with a simple regexp </p>
  
  <pre><code>/^User-Agent:/
  </code></pre>