| 1 | # Copyrights 2001-2023 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 distribution Mail-Message. Meta-POD processed with | ||||||||||||||||||||||||||||||||
| 6 | # OODoc into POD and HTML manual-pages. See README.md | ||||||||||||||||||||||||||||||||
| 7 | # Copyright Mark Overmeer. Licensed under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | package Mail::Message; | ||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | 4 | $VERSION = '3.013'; | |||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||
| 14 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 15 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 4 | ▶ | use IO::Lines; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | sub string() | ||||||||||||||||||||||||||||||||
| 21 | 5 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 22 | 5 | $self->head->string . $self->body->string; | |||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||
| 25 | #------------------------------------------ | ||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | sub lines() | ||||||||||||||||||||||||||||||||
| 29 | 8 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
lines: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 30 | 8 | my @lines; | |||||||||||||||||||||||||||||||
| 31 | 8 | my $file = IO::Lines->new(\@lines); | |||||||||||||||||||||||||||||||
| 32 | 8 | $self->print($file); | |||||||||||||||||||||||||||||||
| 33 | 8 | ▶ | wantarray ? @lines : \@lines; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | #------------------------------------------ | ||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | sub file() | ||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
file: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 41 | 0 | my @lines; | |||||||||||||||||||||||||||||||
| 42 | 0 | my $file = IO::Lines->new(\@lines); | |||||||||||||||||||||||||||||||
| 43 | 0 | $self->print($file); | |||||||||||||||||||||||||||||||
| 44 | 0 | $file->seek(0,0); | |||||||||||||||||||||||||||||||
| 45 | 0 | $file; | |||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | sub printStructure(;$$) | ||||||||||||||||||||||||||||||||
| 50 | 6 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
printStructure: called CC=14 SCAR=27.4
Pod
documented
| |||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | 6 | ▶ | my $indent | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
defined $_[0] and not ref $_[0]
MC/DC0%0/2
defined $_[0] and not ref $_[0]
defined $_[0]
not ref $_[0]
Truth table33%1/3
A and not(B)
A= defined $_[0]B= not ref $_[0]
| |||||||||||||||||||||||||||||||||
| 53 | = @_==2 ? pop | ||||||||||||||||||||||||||||||||
| 54 | : defined $_[0] && !ref $_[0] ? shift | ||||||||||||||||||||||||||||||||
| 55 | : ''; | ||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||
| 57 | 6 | ▶ | my $fh = @_ ? shift : select; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | 6 | my $buffer; # only filled if filehandle==undef | |||||||||||||||||||||||||||||||
| 60 | 6 | ▶ | open $fh, '>:raw', \$buffer unless defined $fh; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||
| 62 | 6 | ▶ | my $subject = $self->get('Subject') || ''; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->get('Subject') || ''
MC/DC100%1/1
$self->get('Subject') || ''
$self->get('Subject')
Truth table100%2/2
A
A= $self->get('Subject')
| |||||||||||||||||||||||||||||||||
| 63 | 6 | ▶ | $subject = ": $subject" if length $subject; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||
| 65 | 6 | ▶ | my $type = $self->get('Content-Type', 0) || ''; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->get('Content-Type', 0) || ''
MC/DC0%0/1
$self->get('Content-Type', 0) || ''
$self->get('Content-Type', 0)
Truth table50%1/2
A
A= $self->get('Content-Type', 0)
| |||||||||||||||||||||||||||||||||
| 66 | 6 | my $size = $self->size; | |||||||||||||||||||||||||||||||
| 67 | 6 | ▶ | my $deleted = $self->label('deleted') ? ', deleted' : ''; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||
| 69 | 6 | my $text = "$indent$type$subject ($size bytes$deleted)\n"; | |||||||||||||||||||||||||||||||
| 70 | 6 | ▶ | ref $fh eq 'GLOB' ? (print $fh $text) : $fh->print($text); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||
| 72 | 6 | my $body = $self->body; | |||||||||||||||||||||||||||||||
| 73 | my @parts | ||||||||||||||||||||||||||||||||
| 74 | 6 | ▶ | = $body->isNested ? ($body->nested) | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 75 | : $body->isMultipart ? $body->parts | ||||||||||||||||||||||||||||||||
| 76 | : (); | ||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||
| 78 | $_->printStructure($fh, $indent.' ') | ||||||||||||||||||||||||||||||||
| 79 | 6 | for @parts; | |||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||
| 81 | 6 | $buffer; | |||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||
| 85 | 4 | 1; | |||||||||||||||||||||||||||||||