← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:14 2021

Filename/usr/local/lib/perl5/site_perl/Mail/AuthenticationResults/Token/Comment.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sMail::AuthenticationResults::Token::Comment::::BEGIN@10Mail::AuthenticationResults::Token::Comment::BEGIN@10
0000s0sMail::AuthenticationResults::Token::Comment::::BEGIN@5Mail::AuthenticationResults::Token::Comment::BEGIN@5
0000s0sMail::AuthenticationResults::Token::Comment::::BEGIN@6Mail::AuthenticationResults::Token::Comment::BEGIN@6
0000s0sMail::AuthenticationResults::Token::Comment::::BEGIN@8Mail::AuthenticationResults::Token::Comment::BEGIN@8
0000s0sMail::AuthenticationResults::Token::Comment::::isMail::AuthenticationResults::Token::Comment::is
0000s0sMail::AuthenticationResults::Token::Comment::::parseMail::AuthenticationResults::Token::Comment::parse
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Mail::AuthenticationResults::Token::Comment;
2# ABSTRACT: Class for modelling AuthenticationResults Header parts detected as comments
3
4require 5.008;
5use strict;
6use warnings;
7our $VERSION = '2.20210112'; # VERSION
8use Carp;
9
10use base 'Mail::AuthenticationResults::Token';
11
12
13sub is {
14 my ( $self ) = @_;
15 return 'comment';
16}
17
18sub parse {
19 my ($self) = @_;
20
21 my $header = $self->{ 'header' };
22 my $value = q{};
23 my $depth = 0;
24
25 my $first = substr( $header,0,1 );
26 if ( $first ne '(' ) {
27 croak 'Not a comment';
28 }
29
30 while ( length $header > 0 ) {
31 my $first = substr( $header,0,1 );
32 $header = substr( $header,1 );
33 $value .= $first;
34 if ( $first eq '(' ) {
35 $depth++;
36 }
37 elsif ( $first eq ')' ) {
38 $depth--;
39 last if $depth == 0;
40 }
41 }
42
43 if ( $depth != 0 ) {
44 croak 'Mismatched parens in comment';
45 }
46
47 $value =~ s/^\(//;
48 $value =~ s/\)$//;
49
50 $self->{ 'value' } = $value;
51 $self->{ 'header' } = $header;
52
53 return;
54}
55
561;
57
58__END__