title: How do I pass Perl arrays to/from SWIG?
body: <p>In Perl, I'm accustomed to passing arrays to and from subs</p>
  
  <pre><code>sub abc {
    foreach my $x (@_) { print $x; }
    return (0, 1, 2);
  }
  </code></pre>
  
  <p>How can I achieve similar behavior with SWIG'ed functions?</p>
  
  <p>SWIG'ing this:</p>
  
  <pre><code>std::vector&lt;int&gt; print_list(std::vector&lt;int&gt; l)
  {
    std::vector&lt;int&gt;::iterator iter;
    for(iter=l.begin(); iter!=l.end(); iter++) {
      printf("int %d\n", *iter);
    }
  
    return l;
  }
  </code></pre>
  
  <p>Yields a sub that expects an array reference and returns an array reference? I'm using the stl templates that come with SWIG.</p>
  
  <p>Do I need to write a typemap for this? Seems this would already be covered somewhere.</p>