line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl -c |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Exception::Fatal; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Exception::Fatal - Thrown when core function has a fatal error |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Exception::Fatal; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
eval { |
14
|
|
|
|
|
|
|
open my $fh, '/etc/passwd', '+badmode'; |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
if ($@) { |
17
|
|
|
|
|
|
|
my $e = Exception::Fatal->catch; |
18
|
|
|
|
|
|
|
$e->throw( message => 'Cannot open' ); |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 DESCRIPTION |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This class is an L exception thrown when core function has a |
24
|
|
|
|
|
|
|
trappable fatal error. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=for readme stop |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
1
|
|
13
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
31
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
32
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $VERSION = 0.05; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
use Exception::Base 0.21 ( |
38
|
1
|
|
|
|
|
7
|
'Exception::Fatal' => { |
39
|
|
|
|
|
|
|
isa => 'Exception::Died', |
40
|
|
|
|
|
|
|
message => 'Unknown function failed', |
41
|
|
|
|
|
|
|
}, |
42
|
1
|
|
|
1
|
|
7
|
); |
|
1
|
|
|
|
|
14
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |