Subject: Re: Common Lisp and Python performance
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 5 Jan 2001 11:46:50 GMT
Newsgroups: comp.lang.lisp
Message-ID: <934c7a$ljcic$1@fido.engr.sgi.com>
Aaron Kushner  <akushner@pacbell.net> wrote:
+---------------
| ...an automated email responder I wrote...  it reads in the incoming
| message, grabs the headers, and creates a new outgoing message.
| 	($inHeader, $inMessage) = split(/\n\n/,$incoming,2);
|         # Save headers so we can send mail back to user
|         @headers = split(/\n/,$inHeader);
|         foreach $hdr (@headers) {
|                 (undef, $mail{'Subject'}) = split(/: /,$hdr) 
|                     if $hdr =~ m/^Subject:/;
|                 (undef, $mail{'From'}) = split(/: /,$hdr) 
|                     if $hdr =~ m/^To:/;
|                 (undef, $mail{'To'}) = split(/: /,$hdr) 
|                     if $hdr =~ m/^From:/;
|                 (undef, $mail{'To'}) = split(/: /,$hdr) 
|                     if $hdr =~ m/^Reply-To:/;
|         }
+---------------

I don't claim to be a Perl expert, but this code looks seriously
broken w.r.t. the RFC 822 syntax for headers. AFAICT it doesn't
handle continuation lines at all!!


-Rob

-----
Rob Warnock, 31-2-510		rpw3@sgi.com
SGI Network Engineering		http://reality.sgi.com/rpw3/
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA