| E-Mail-Acme documentation | Contained in the E-Mail-Acme distribution. |
Email::Abstract::EMailAcme - pose as a more convoluted representation of e-mail
version 1349
my $abstract = Email::Abstract->new($e_mail);
Some people are going to require you to use some obnoxious form of e-mail object full of methods and subobjects. Email::Abstract lets you use an abstract wrapper that converts between all seamlessly. This is an adapter class to let Email::Abstract work with E'Mail::Acme.
See Email::Abstract
Ricardo SIGNES wrote this module on Monday, July 16, 2007.
This code is copyright (c) 2007, Ricardo SIGNES. It is free software, available under the same terms as Perl itself.
| E-Mail-Acme documentation | Contained in the E-Mail-Acme distribution. |
use strict; ## no critic warnings # let's be 5.00x compatible package Email::Abstract::EMailAcme; $Email::Abstract::EMailAcme::VERSION = 1505; sub target { "E::Mail::Acme" } sub get_header { my ($self, $e_mail, $header) = @_; return unless exists $e_mail->{$header}; if (wantarray) { return @{ $e_mail->{$header} }; } else { return $e_mail->{$header}->[0]; } } sub set_header { my ($self, $e_mail, $header, @values) = @_; my $hvalue = $e_mail->{$header}; splice @$hvalue, 0, scalar(@$hvalue), @values; #$e_mail->{$header} = \@values if @values; } sub get_body { my ($self, $e_mail) = @_; my $whole = "$e_mail"; my $head = $e_mail->{''}; $whole =~ s/\A\Q$head\E\x0d\x0a//; return $whole; } sub set_body { my ($self, $e_mail, $string) = @_; @$e_mail = [ $string ]; } sub as_string { my ($self, $e_mail) = @_; "$e_mail"; } '200-sorry'; __END__