| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Carp::Parse::CallerInformation; |
|
2
|
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
35006
|
use warnings; |
|
|
9
|
|
|
|
|
14
|
|
|
|
9
|
|
|
|
|
254
|
|
|
4
|
9
|
|
|
9
|
|
49
|
use strict; |
|
|
9
|
|
|
|
|
15
|
|
|
|
9
|
|
|
|
|
240
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
50
|
use Carp; |
|
|
9
|
|
|
|
|
17
|
|
|
|
9
|
|
|
|
|
547
|
|
|
7
|
9
|
|
|
9
|
|
8921
|
use Data::Dump; |
|
|
9
|
|
|
|
|
86840
|
|
|
|
9
|
|
|
|
|
3017
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Carp::Parse::CallerInformation - Represent the parsed caller information for a line of the Carp stack trace. |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 VERSION |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Version 1.0.7 |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $VERSION = '1.0.7'; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
See the synopsis of C for a full example that generates |
|
27
|
|
|
|
|
|
|
Carp::Parse::CallerInformation objects. As a user, you should not have to |
|
28
|
|
|
|
|
|
|
create Carp::Parse::CallerInformation objects yourself. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Retrieve the arguments string. |
|
31
|
|
|
|
|
|
|
my $arguments_string = $caller_information->get_arguments_string(); |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Retrieve the arguments array. |
|
34
|
|
|
|
|
|
|
my $arguments_list = $caller_information->get_arguments_list(); |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Retrieve the original line, pre-parsing. |
|
37
|
|
|
|
|
|
|
my $line = $caller_information->get_line(); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 new() |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Create a new C object. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $caller_information = Carp::Parse::CallerInformation->new( |
|
47
|
|
|
|
|
|
|
{ |
|
48
|
|
|
|
|
|
|
arguments_string => $arguments_string, |
|
49
|
|
|
|
|
|
|
arguments_list => $arguments_list, |
|
50
|
|
|
|
|
|
|
line => $line, |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
); |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub new |
|
57
|
|
|
|
|
|
|
{ |
|
58
|
20
|
|
|
20
|
1
|
3115
|
my ( $class, $data ) = @_; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# Verify parameters. |
|
61
|
20
|
100
|
66
|
|
|
182
|
croak 'The first argument must be a hashref with the data to set on the object.' |
|
62
|
|
|
|
|
|
|
unless defined( $data ) && UNIVERSAL::isa( $data, 'HASH' ); ## no critic (BuiltinFunctions::ProhibitUniversalIsa) |
|
63
|
19
|
|
|
|
|
56
|
my $line = delete( $data->{'line'} ); |
|
64
|
19
|
|
|
|
|
47
|
my $arguments_string = delete( $data->{'arguments_string'} ); |
|
65
|
19
|
|
|
|
|
51
|
my $arguments_list = delete( $data->{'arguments_list'} ); |
|
66
|
19
|
100
|
|
|
|
75
|
croak "The data hashref must contain the 'line' key with the original stack line" |
|
67
|
|
|
|
|
|
|
unless defined( $line ); |
|
68
|
18
|
50
|
|
|
|
73
|
croak "The following parameters are not supported: " . Data::Dump::dump( $data ) |
|
69
|
|
|
|
|
|
|
if scalar( keys %$data ) != 0; |
|
70
|
|
|
|
|
|
|
|
|
71
|
18
|
|
|
|
|
166
|
return bless( |
|
72
|
|
|
|
|
|
|
{ |
|
73
|
|
|
|
|
|
|
line => $line, |
|
74
|
|
|
|
|
|
|
arguments_string => $arguments_string, |
|
75
|
|
|
|
|
|
|
arguments_list => $arguments_list, |
|
76
|
|
|
|
|
|
|
}, |
|
77
|
|
|
|
|
|
|
$class, |
|
78
|
|
|
|
|
|
|
); |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 get_arguments_string() |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Return a string of the arguments parsed for this caller. |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
my $arguments_string = $caller_information->get_arguments_string(); |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub get_arguments_string |
|
91
|
|
|
|
|
|
|
{ |
|
92
|
1
|
|
|
1
|
1
|
8
|
my ( $self ) = @_; |
|
93
|
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
12
|
return $self->{'arguments_string'}; |
|
95
|
|
|
|
|
|
|
} |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 get_arguments_list() |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Return an arrayref of the arguments parsed for this caller. |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
my $arguments_list = $caller_information->get_arguments_list(); |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub get_arguments_list |
|
107
|
|
|
|
|
|
|
{ |
|
108
|
1
|
|
|
1
|
1
|
9
|
my ( $self ) = @_; |
|
109
|
|
|
|
|
|
|
|
|
110
|
1
|
|
|
|
|
14
|
return $self->{'arguments_list'}; |
|
111
|
|
|
|
|
|
|
} |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 get_line() |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Return the original line from the stack trace. |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
my $line = $caller_information->get_line(); |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub get_line |
|
123
|
|
|
|
|
|
|
{ |
|
124
|
1
|
|
|
1
|
1
|
7
|
my ( $self ) = @_; |
|
125
|
|
|
|
|
|
|
|
|
126
|
1
|
|
|
|
|
10
|
return $self->{'line'}; |
|
127
|
|
|
|
|
|
|
} |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 AUTHOR |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Kate Kirby, C<< >>. |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Guillaume Aubert, C<< >>. |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 BUGS |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
|
140
|
|
|
|
|
|
|
the web interface at L. |
|
141
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
|
142
|
|
|
|
|
|
|
your bug as I make changes. |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 SUPPORT |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
perldoc Carp::Parse::CallerInformation |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
You can also look for information at: |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=over 4 |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
L |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
L |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
L |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item * Search CPAN |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
L |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=back |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Thanks to ThinkGeek (L) and its corporate overlords |
|
178
|
|
|
|
|
|
|
at Geeknet (L), for footing the bill while we eat pizza |
|
179
|
|
|
|
|
|
|
and write code for them! |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
Copyright 2012 Kate Kirby & Guillaume Aubert. |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=cut |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
1; |