Help for this page

Select Code to Download


  1. or download this
    my $saved_value;
    END { $? = $saved_value } # this will be the final END block
    ...
    #### using whatever modules you want
    
    END { $saved_value = $? # } # this will be the first END block
    
  2. or download this
    sub my_exit {
      my $value = shift;
      $saved_value = $value;
      exit $value;
    }