From: "Janek Schleicher" <janek_schleic...@yahoo.de>
Am 24.10.2013 15:07, schrieb Shawn H Corey:
my $email = Email::Simple->create(
header => [
From => $sender_addr,
To => 'ad...@tristatelogic.com',
X-Server-Protocol => $server_protocol,
X-Http-User-Agent => $http_user_agent,
X-Http-Referer => $http_referer,
X-Remote-Addr => $remote_addr,
X-Remote-Host => $remote_host,
],
body => $message
);
Why are you using an anonymous array for the header? Wouldn't an
anonymous hash be better? A hash would insist on an even number of
elements.
I just followed the synopsis of the documentation of this CPAN-Module as
you can find it here: https://metacpan.org/pod/Email::Simple :-)
I agree to you, that a ref to a hash like header => { ... } would somehow
be more logic, but I didn't wrote this CPAN module.
Aren't duplicate headers allowed in email headers?
Because if they are allowed, maybe this is the reason an arrayref is used,
and not a hashref.
Octavian
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/