I'm writing a home boy mail/news search tool and wondered if there is a cononical way to handle folded or indented header lines.
There are modules to help read mail headers, but if you want something simple you can modify the following example:
#!/usr/bin/perl
use strict; use warnings;
open(MAIL, 'mail.msg') or die $!;
my $line; LINE: while (<MAIL>) { chomp; if (1../^$/) { unless (/^\s/) { print "$line\n"; $line = $_; } else { s/^\s+/ /; $line .= $_; next LINE; } } }
You can perform your matches at the point where I placed the print statement; at that point a complete line is assembled.
Regards, Randy.
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>