On Oct 24, 2013, at 6:07 AM, Shawn H Corey wrote:

> On Thu, 24 Oct 2013 13:52:51 +0200
> Janek Schleicher <janek_schleic...@yahoo.de> wrote:
> 
>> use Email::Simple;
>> 
>> 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.

According to the documentation for Email::Simple, an anonymous array is 
required for the header parameter of the create method.

<http://search.cpan.org/~rjbs/Email-Simple-2.202/lib/Email/Simple.pm#create>

Suggestions for improvement should be directed to the module's author (but you 
knew that, right?).


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to