In message <7E7181F2497441C88988DD1F16E4A743@octavianf303f0>, you wrote:
>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? Yes. The vast majority of all the e-mail I have in my big piles of e-mails has multiple Received: headers, in particular. And yes, order matters with respect to interpreting those (but also it matters in the case of other headres sometimes too.) But, getting back to my original 2 questions... I want to stress that I did not ask how to formulate and/or send a properly formatted e-mail message. I can handle that part, even if perhaps only in my own clumsey way. What is of more interest to me, again, is the question of how to properly validate (a) a string that's given on a form and which is meant to represent a person's name, an also (b) a string that is given in a form and that is supposed to represent a person's e-mail address. Assume that I want to do both these things *and*, to the maximum extent possible, I want to reject any & all strings that are implausible name and/or e-mail address strings. How? What's the code to do each of these things. These certainly should both be well-solved problems by now, but in case they aren't, I'd like to take my own humble wack at developing good solutions for both problems. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/