Mail/Mailer/rfc822.pm

filter: Statementstmt 50.0% 10 / 20 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 38.7% 12 / 31 CC 5 SCAR 30.8
CC
5
Cov
40%
set_headers
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 21.7
« Mail/Header.pm ↑ Summary Mail/Field.pm »
1 # Copyrights 1995-2024 by [Mark Overmeer <markov@cpan.org>].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.03.
5 # This code is part of the bundle MailTools. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md for Copyright.
7 # Licensed under the same terms as Perl itself.
8  
9 package Mail::Mailer::rfc822;{
10 1 our $VERSION = '2.22';
11 }
12  
13 1 ▶use base 'Mail::Mailer';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 # Some fields are not allowed to repeat
18 1 my %max_once = map +($_ => 1), qw/from to cc bcc reply-to/;
19  
20 sub set_headers
21 0 ▶{ my ($self, $hdrs) = @_;
Subroutine set_headers: not called CC=5 SCAR=34.0
Pod undocumented
22 0 local $\ = "";
23  
24 0 foreach my $f (grep /^[A-Z]/, keys %$hdrs)
25 { # s///r requires perl 5.12: too new :-)
26 0 my @h = map { my $h = $_; $h =~ s/\n+\Z//; $h } $self->to_array($hdrs->{$f});
27 0 ▶ @h = join ', ', @h if @h && $max_once{lc $f};
Branch: 1 branch
BranchTrueFalseTotal
if @h and $max_once{lc $f} 0 0 0
Condition0%0/3
@h and $max_once{lc $f}
!ll&&!rl&&r
000
MC/DC0%0/2
@h and $max_once{lc $f}
@h $max_once{lc $f}
Truth table0%0/3
A and B
A= @hB= $max_once{lc $f}
ABresult
0X0
100
111
28 0 print $self "$f: $_\n" for @h;
29 }
30  
31 0 print $self "\n"; # end of headers
32 }
33  
34 1 1;
« Mail/Header.pm ↑ Summary Mail/Field.pm »