title: How do I use an 'if' statement in Perl?
body: <p>Consider:</p>
  
  <pre><code>#!/usr/bin/perl
  if ($ARGV[0]=="-v") {
      print "MY name: abc\n";
      print "MY student ID:111110\n";
  }
  if ($ARGV[0]=="-s" &amp;&amp; $ARGV[1]==printing_usage_file) {
      open (INFILE, $ARGV[1]) or die "An input file is required as argument\n";
      $totalbytes=0;
      $data="";
      while(&lt;INFILE&gt;) {
          chomp();
          @data=split(/,/);
          $totalbytes += $data[1];
      }
      print "Total number of bytes printed: $totalbytes\n";
  }
  </code></pre>
  
  <p>In this case, what I want is when I run <code>./perl.pl -v</code>, it prints <code>my name</code> and <code>id</code>.</p>
  
  <p>When I run <code>./perl.pl -s  printing_usage_file</code>, it prints the <code>totalbytes(printing_usage_file file is list like:aaa,240,ccc)</code>.</p>
  
  <p>But here when I run <code>/perl.pl -v</code> or <code>./perl.pl -s printing_usage_file</code> it prints <code>my name</code>,<code>id</code> and the <code>totalbytes</code>. How can I fix it?</p>