title: how to get user input and use that value in the script for Perl
body: <p>I need to do the following:</p>
  
  <pre><code>Print "User please enter the age, sex, blah_blah" &gt; $age&gt;$sex&gt;$blah_blah;
  
  
  print "the current user stats are- age = $age, sex = $sex";
  
  my $rand;
  
  if ($blah_blah &gt; $rand)
  
        {
  
        do something
  
        }
  
  else 
  
        {
        something else
        }
  </code></pre>
  
  <p>Can someone help me with to take inputs from the user and then be able to use that value in the script?</p>
  
  <p>I also want to be able to run this script as:</p>
  
  <pre><code>perl script1 -age -sex -blah_blah
  </code></pre>
  
  <p>By that I mean instead of asking the user to provide these values can I simply type these in the command line and can my script still use these as above?</p>
  
  <p>Is this possible? If so, can I also add <code>-help</code> i.e. <code>perl script1 -help</code> and if this could print out some comments from the script?</p>