line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Error::Pure::ANSIColor::PrintVar; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
74935
|
use base qw(Exporter); |
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
281
|
|
4
|
2
|
|
|
2
|
|
36
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
67
|
|
5
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
68
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1068
|
use Error::Pure::Output::ANSIColor qw(err_print_var); |
|
2
|
|
|
|
|
34801
|
|
|
2
|
|
|
|
|
71
|
|
8
|
2
|
|
|
2
|
|
1291
|
use Error::Pure::Utils qw(err_helper); |
|
2
|
|
|
|
|
3147
|
|
|
2
|
|
|
|
|
35
|
|
9
|
2
|
|
|
2
|
|
146
|
use List::Util qw(none); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
252
|
|
10
|
2
|
|
|
2
|
|
14
|
use Readonly; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
545
|
|
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.29; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Process error. |
20
|
|
|
|
|
|
|
sub err { |
21
|
0
|
|
|
0
|
1
|
|
my @msg = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Get errors structure. |
24
|
0
|
|
|
|
|
|
my @errors = err_helper(@msg); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Finalize in main on last err. |
27
|
0
|
|
|
|
|
|
my $stack_ar = $errors[-1]->{'stack'}; |
28
|
0
|
0
|
0
|
|
|
|
if ($stack_ar->[-1]->{'class'} eq 'main' |
29
|
0
|
0
|
|
0
|
|
|
&& none { $_ eq $EVAL || $_ =~ /^eval '/ms } |
30
|
0
|
|
|
|
|
|
map { $_->{'sub'} } @{$stack_ar}) { |
|
0
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
die scalar err_print_var(@errors); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Die for eval. |
35
|
|
|
|
|
|
|
} else { |
36
|
0
|
|
|
|
|
|
die "$errors[-1]->{'msg'}->[0]\n"; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |