Help for this page

Select Code to Download


  1. or download this
    sub methodfunction {
        # take a spoonful
        die 'too hot'  if $temp > $hottest_allowed;
        die 'too cold' if $temp < $coldest_allowed;
    }
    
  2. or download this
    sub rollback {
        my $undesired = shift;
        print "That was $undesired. I shall try another bowl.\n";
    ...
    # and later ...
    eval {methodfunction()};
    rollback($EVAL_ERROR) if $EVAL_ERROR;