line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::AuthenticationResults::Token::QuotedString; |
2
|
|
|
|
|
|
|
# ABSTRACT: Class for modelling AuthenticationResults Header parts detected as quoted strings |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
require 5.008; |
5
|
25
|
|
|
25
|
|
568
|
use strict; |
|
25
|
|
|
|
|
51
|
|
|
25
|
|
|
|
|
778
|
|
6
|
25
|
|
|
25
|
|
125
|
use warnings; |
|
25
|
|
|
|
|
47
|
|
|
25
|
|
|
|
|
973
|
|
7
|
|
|
|
|
|
|
our $VERSION = '2.20230112'; # VERSION |
8
|
25
|
|
|
25
|
|
122
|
use Carp; |
|
25
|
|
|
|
|
67
|
|
|
25
|
|
|
|
|
1258
|
|
9
|
|
|
|
|
|
|
|
10
|
25
|
|
|
25
|
|
138
|
use base 'Mail::AuthenticationResults::Token'; |
|
25
|
|
|
|
|
65
|
|
|
25
|
|
|
|
|
8183
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub is { |
14
|
192
|
|
|
192
|
1
|
257
|
my ( $self ) = @_; |
15
|
192
|
|
|
|
|
375
|
return 'string'; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub parse { |
19
|
42
|
|
|
42
|
1
|
60
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
|
21
|
42
|
|
|
|
|
61
|
my $header = $self->{ 'header' }; |
22
|
42
|
|
|
|
|
53
|
my $value = q{}; |
23
|
|
|
|
|
|
|
|
24
|
42
|
|
|
|
|
66
|
my $first = substr( $header,0,1 ); |
25
|
42
|
|
|
|
|
99
|
$header = substr( $header,1 ); |
26
|
42
|
100
|
|
|
|
102
|
croak 'not a quoted string' if $first ne '"'; |
27
|
|
|
|
|
|
|
|
28
|
41
|
|
|
|
|
52
|
my $closed = 0; |
29
|
41
|
|
|
|
|
72
|
while ( length $header > 0 ) { |
30
|
368
|
|
|
|
|
445
|
my $first = substr( $header,0,1 ); |
31
|
368
|
|
|
|
|
506
|
$header = substr( $header,1 ); |
32
|
368
|
100
|
|
|
|
569
|
if ( $first eq '"' ) { |
33
|
40
|
|
|
|
|
48
|
$closed = 1; |
34
|
40
|
|
|
|
|
54
|
last; |
35
|
|
|
|
|
|
|
} |
36
|
328
|
|
|
|
|
507
|
$value .= $first; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
41
|
100
|
|
|
|
84
|
croak 'Quoted string not closed' if ! $closed; |
40
|
|
|
|
|
|
|
|
41
|
40
|
|
|
|
|
62
|
$self->{ 'value' } = $value; |
42
|
40
|
|
|
|
|
53
|
$self->{ 'header' } = $header; |
43
|
|
|
|
|
|
|
|
44
|
40
|
|
|
|
|
67
|
return; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |