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