title: Returning error messages from perl subroutines
body: <p>Is this a good way of returning an error messages from a subroutine in perl?</p>
  
  <pre><code>sub some_subroutine{
      # do something
      $something = 14;
  
      if(1 == 2){
          $_ = "This should not be happening!";
          return undef;
      }
      return $something;
  }
  
  my $ret=some_subroutine();
  print "ERROR: $_" unless(defined $ret);
  </code></pre>
  
  <p>The code runs OK (in a parallel world, where <code>1 == 2</code>), but using <code>$_</code> to return the error message is a good way? I didn't found any documentation regarding the usage of <code>$_</code> for this kind of purposes.</p>
  
  <p>Thank you!</p>