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
|
24
|
|
|
24
|
|
577
|
use strict; |
|
24
|
|
|
|
|
47
|
|
|
24
|
|
|
|
|
703
|
|
6
|
24
|
|
|
24
|
|
120
|
use warnings; |
|
24
|
|
|
|
|
53
|
|
|
24
|
|
|
|
|
908
|
|
7
|
|
|
|
|
|
|
our $VERSION = '2.20210914'; # VERSION |
8
|
24
|
|
|
24
|
|
129
|
use Carp; |
|
24
|
|
|
|
|
45
|
|
|
24
|
|
|
|
|
1642
|
|
9
|
|
|
|
|
|
|
|
10
|
24
|
|
|
24
|
|
194
|
use base 'Mail::AuthenticationResults::Token'; |
|
24
|
|
|
|
|
79
|
|
|
24
|
|
|
|
|
8437
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub is { |
14
|
192
|
|
|
192
|
1
|
261
|
my ( $self ) = @_; |
15
|
192
|
|
|
|
|
417
|
return 'string'; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub parse { |
19
|
42
|
|
|
42
|
1
|
58
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
|
21
|
42
|
|
|
|
|
65
|
my $header = $self->{ 'header' }; |
22
|
42
|
|
|
|
|
68
|
my $value = q{}; |
23
|
|
|
|
|
|
|
|
24
|
42
|
|
|
|
|
68
|
my $first = substr( $header,0,1 ); |
25
|
42
|
|
|
|
|
98
|
$header = substr( $header,1 ); |
26
|
42
|
100
|
|
|
|
117
|
croak 'not a quoted string' if $first ne '"'; |
27
|
|
|
|
|
|
|
|
28
|
41
|
|
|
|
|
59
|
my $closed = 0; |
29
|
41
|
|
|
|
|
76
|
while ( length $header > 0 ) { |
30
|
368
|
|
|
|
|
441
|
my $first = substr( $header,0,1 ); |
31
|
368
|
|
|
|
|
547
|
$header = substr( $header,1 ); |
32
|
368
|
100
|
|
|
|
545
|
if ( $first eq '"' ) { |
33
|
40
|
|
|
|
|
59
|
$closed = 1; |
34
|
40
|
|
|
|
|
61
|
last; |
35
|
|
|
|
|
|
|
} |
36
|
328
|
|
|
|
|
517
|
$value .= $first; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
41
|
100
|
|
|
|
86
|
croak 'Quoted string not closed' if ! $closed; |
40
|
|
|
|
|
|
|
|
41
|
40
|
|
|
|
|
65
|
$self->{ 'value' } = $value; |
42
|
40
|
|
|
|
|
55
|
$self->{ 'header' } = $header; |
43
|
|
|
|
|
|
|
|
44
|
40
|
|
|
|
|
68
|
return; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |