title: How can I execute a Perl script using the Ant exec task?
body: <p>I currently have this in my Ant build script:</p>
  
  <pre><code>&lt;exec dir="${basedir}" executable="perl"&gt;
      &lt;arg line="${basedir}/version.pl -major"/&gt;
  &lt;/exec&gt;
  </code></pre>
  
  <p>However, when that runs, I get this error message:</p>
  
  <blockquote>
    <p>[exec] Could not open -major <br/>
    [exec] Result: 2</p>
  </blockquote>
  
  <p>To me, that says that what I have is trying to run a file called -major, which doesn't exist. The file is version.pl which takes an argument of -major.</p>
  
  <p>How can I alter this to run version.pl with the argument -major?</p>
  
  <p>Note that I am running the ant script on a Solaris machine, however cross-platform or solutions for other OSes are welcome for posterity.</p>