title: Exit Codes when using die in Perl
body: <p>I have overridden <code>die</code> in perl for my logging framework, so that it can log messages and print it on console. </p>
  
  <p><strong>Overridden code for die:</strong></p>
  
  <pre><code>BEGIN{ *CORE::GLOBAL::die = sub { 
          my ($package, $filename, $line, $subroutine) = caller;
          untie *STDERR;
          my $message;
          foreach my $arg (@_) {
              $message = $message.$arg;
          }
  
          print STDERR $message;
          tie *STDERR, __PACKAGE__, (*STDERR);
          logmessage("die",$message,$filename, $line);
          #What exit code to pass?
          #exit CODE;
      }
  }
  </code></pre>
  
  <p>I don't know what exit code to set while exiting the process as the normal die exits with an error code.</p>
  
  <ul>
  <li><p>Is there any way I can find out what exit code to set when die is
  called?</p></li>
  <li><p>Also It would be helpful if can know the list of error codes availabe
  in perl?</p></li>
  </ul>