File Coverage

blib/lib/Mail/Message/Construct.pm
Criterion Covered Total %
statement 16 19 84.2
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod n/a
total 22 27 81.4


line stmt bran cond sub pod time code
1             # This code is part of Perl distribution Mail-Message version 4.04.
2             # The POD got stripped from this file by OODoc version 3.06.
3             # For contributors see file ChangeLog.
4              
5             # This software is copyright (c) 2001-2026 by Mark Overmeer.
6              
7             # This is free software; you can redistribute it and/or modify it under
8             # the same terms as the Perl 5 programming language system itself.
9             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10              
11              
12             package Mail::Message;{
13             our $VERSION = '4.04';
14             }
15              
16              
17 37     37   267 use strict;
  37         83  
  37         1814  
18 37     37   196 use warnings;
  37         116  
  37         2838  
19              
20 37     37   245 use Log::Report 'mail-message', import => [ qw// ];
  37         83  
  37         353  
21              
22             #--------------------
23              
24             our %locations = (
25             bounce => 'Bounce',
26              
27             build => 'Build',
28             buildFromBody => 'Build',
29              
30             forward => 'Forward',
31             forwardNo => 'Forward',
32             forwardInline => 'Forward',
33             forwardAttach => 'Forward',
34             forwardEncapsulate => 'Forward',
35             forwardSubject => 'Forward',
36             forwardPrelude => 'Forward',
37             forwardPostlude => 'Forward',
38              
39             read => 'Read',
40              
41             rebuild => 'Rebuild',
42              
43             reply => 'Reply',
44             replySubject => 'Reply',
45             replyPrelude => 'Reply',
46              
47             string => 'Text',
48             lines => 'Text',
49             file => 'Text',
50             printStructure => 'Text',
51             );
52              
53             sub AUTOLOAD(@)
54 17     17   1487654 { my $self = shift;
55 17         39 our $AUTOLOAD;
56 17         134 my $call = $AUTOLOAD =~ s/.*\:\://gr;
57              
58 17 50       145 if(my $mod = $locations{$call})
59 17         1330 { eval "require Mail::Message::Construct::$mod";
60 17 50       110 die $@ if $@;
61 17         155 return $self->$call(@_);
62             }
63              
64 0           our @ISA; # produce error via Mail::Reporter
65 0           $call = "${ISA[0]}::$call";
66 0           $self->$call(@_);
67             }
68              
69             1;