Help for this page

Select Code to Download


  1. or download this
    #! perl -slw
    use strict;
    ...
    my $result = eval{ divide( @ARGV ) } or die $@;
    
    print "Result: $result";
    
  2. or download this
    __END__
    C:\test>NoExceptions
    ...
    
    C:\test>NoExceptions 1 2
    Result: 0.5
    
  3. or download this
    #MyExceptions.pm
    package MyExceptions;
    ...
        $e = Exception::Class->caught();
        ref $e ? $e->rethrow : die $e;
    }
    
  4. or download this
    #! perl -slw
    use strict;
    ...
    };
    
    print "Result: $result";
    
  5. or download this
    __END__
    C:\test>Exceptions-TryTiny
    ...
    C:\test>Exceptions-TryTiny 1 2
    Result: 0.5