title: Need a function to do this in Perl
body: <p>Sample Input:</p>
  
  <pre><code>ATAT
  
  GATATATGCATATACTT
  </code></pre>
  
  <p>Sample Output:</p>
  
  <pre><code>1 3 9
  </code></pre>
  
  <p>I get the regex part but I don't understand how we can use a position instance.</p>