title: Perl script with options
body: <p>I am looking for a Perl script which does the following:</p>
  <ol>
  <li><p>takes two options, like <code>script.pl -option1 -option2</code></p>
  </li>
  <li><p>Option 1 has two choices, say <code>choice1</code> and <code>choice2</code> and I have shell code
  to do both actions (which I hope I can port to Perl)</p>
  </li>
  <li><p>Here option 2 is the path and is optional. If it's not specified it uses the current directory</p>
  </li>
  </ol>
  <h3>Desired script</h3>
  <pre class="lang-none prettyprint-override"><code>checks arguments
  
  if choice 1 :
  
  go to path (arg2)
  
  run a code (i have it ready)
  
  If choice 2
  
   go to path (arg2 )
   
   run a code
   
  </code></pre>