Help for this page

Select Code to Download


  1. or download this
    eval {
       ... code that might die ...
    ...
       # if we had an error.
       ... read $@ and decide on what to do ...
    }
    
  2. or download this
    $SIG{__DIE__} = \&my_death;
    
    ...
       warn @_;          #propagate the message via warn()
       POSIX::_exit(42); #exit with code 42
    }
    
  3. or download this
    sub main {
       ... main program logic ...
    ...
    if ($@) {
       ... handle any fatal errors ...
    }
    
  4. or download this
    eval { main() };
    if ($@) {
    ...
       close_all_files();
       issue_done_to_server();
    }