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             # Copyrights 2001-2021 by [Mark Overmeer ].
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.02.
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 31     31   236 use vars '$VERSION';
  31         72  
  31         2013  
11             $VERSION = '3.011';
12              
13              
14 31     31   206 use strict;
  31         64  
  31         760  
15 31     31   226 use warnings;
  31         73  
  31         8050  
16              
17              
18             our %locations =
19             (
20             bounce => 'Bounce'
21              
22             , build => 'Build'
23             , buildFromBody => 'Build'
24              
25             , forward => 'Forward'
26             , forwardNo => 'Forward'
27             , forwardInline => 'Forward'
28             , forwardAttach => 'Forward'
29             , forwardEncapsulate => 'Forward'
30             , forwardSubject => 'Forward'
31             , forwardPrelude => 'Forward'
32             , forwardPostlude => 'Forward'
33              
34             , read => 'Read'
35              
36             , rebuild => 'Rebuild'
37              
38             , reply => 'Reply'
39             , replySubject => 'Reply'
40             , replyPrelude => 'Reply'
41              
42             , string => 'Text'
43             , lines => 'Text'
44             , file => 'Text'
45             , printStructure => 'Text'
46             );
47              
48             sub AUTOLOAD(@)
49 12     12   3396 { my $self = shift;
50 12         29 our $AUTOLOAD;
51 12         87 (my $call = $AUTOLOAD) =~ s/.*\:\://g;
52              
53 12 50       88 if(my $mod = $locations{$call})
54 12         946 { eval "require Mail::Message::Construct::$mod";
55 12 50       83 die $@ if $@;
56 12         104 return $self->$call(@_);
57             }
58              
59 0           our @ISA; # produce error via Mail::Reporter
60 0           $call = "${ISA[0]}::$call";
61 0           $self->$call(@_);
62             }
63              
64             1;