title: best way to execute unix commands within a perl script and to check if it failed
body: <p>I want to execute a couple of unix commands within perl. What's the best way to do so?
  Is it better to use qx or system()? Is there a good way to check if it fails? Can someone show me a good example? Thanks.</p>
  
  <pre><code>my $crflag=qx('/bin/touch /tmp/flag.done');
  my $chgperm=qx('chmod 755 /tmp/flag.done');
  </code></pre>
  
  <p>vs.</p>
  
  <pre><code>my $crflag = '/bin/touch /tmp/flag.done';
  my $chgperm ='chmod 755 /tmp/flag.done';
  system ($crflag);
  system ($chgperm);
  </code></pre>