title: How can I filter a large file into two separate files?
body: <p>I've got a huge file (500 MB) that is organized like this:</p>
  
  <pre><code>&lt;link type="1-1" xtargets="1;1"&gt;
      &lt;s1&gt;bunch of text here&lt;/s1&gt;
      &lt;s2&gt;some more here&lt;/s2&gt;
  &lt;/link&gt;
  &lt;link type="1-1" xtargets="1;1"&gt;
      &lt;s1&gt;bunch of text here&lt;/s1&gt;
      &lt;s2&gt;some more here&lt;/s2&gt;
  &lt;/link&gt;
  &lt;link type="1-1" xtargets="1;1"&gt;
      &lt;s1&gt;bunch of text here&lt;/s1&gt;
      &lt;s2&gt;some more here&lt;/s2&gt;
  &lt;/link&gt;
  </code></pre>
  
  <p>I'd like to transform this into a new format where s1 goes to a new file with each s1 on its own line with a line break, and s2 goes to a new file with each s2 on its own line.</p>
  
  <p>Is Perl the way to go here?  If so, can someone let me know how I can accomplish this? </p>