line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Error::Pure::PrintVar; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
76987
|
use base qw(Exporter); |
|
3
|
|
|
|
|
28
|
|
|
3
|
|
|
|
|
424
|
|
4
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
68
|
|
5
|
3
|
|
|
3
|
|
24
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
101
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1242
|
use Error::Pure::Utils qw(err_helper); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
59
|
|
8
|
3
|
|
|
3
|
|
1760
|
use Error::Pure::Output::Text qw(err_print_var); |
|
3
|
|
|
|
|
4365
|
|
|
3
|
|
|
|
|
68
|
|
9
|
3
|
|
|
3
|
|
279
|
use List::Util qw(none); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
309
|
|
10
|
3
|
|
|
3
|
|
22
|
use Readonly; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
800
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constants. |
13
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(err); |
14
|
|
|
|
|
|
|
Readonly::Scalar my $EMPTY_STR => q{}; |
15
|
|
|
|
|
|
|
Readonly::Scalar my $EVAL => 'eval {...}'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = 0.31; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Process error. |
20
|
|
|
|
|
|
|
sub err { |
21
|
5
|
|
|
5
|
1
|
2668
|
my @msg = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Get errors structure. |
24
|
5
|
|
|
|
|
19
|
my @errors = err_helper(@msg); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Finalize in main on last err. |
27
|
5
|
|
|
|
|
12
|
my $stack_ar = $errors[-1]->{'stack'}; |
28
|
5
|
50
|
33
|
|
|
28
|
if ($stack_ar->[-1]->{'class'} eq 'main' |
29
|
10
|
100
|
|
10
|
|
44
|
&& none { $_ eq $EVAL || $_ =~ /^eval '/ms } |
30
|
10
|
|
|
|
|
31
|
map { $_->{'sub'} } @{$stack_ar}) { |
|
5
|
|
|
|
|
11
|
|
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
0
|
die scalar err_print_var(@errors); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Die for eval. |
35
|
|
|
|
|
|
|
} else { |
36
|
5
|
|
|
|
|
39
|
die "$errors[-1]->{'msg'}->[0]\n"; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |