develooper Front page | perl.beginners | Postings from January 2002

Matching Problem

Thread Next
From:
Lysander
Date:
January 15, 2002 14:07
Subject:
Matching Problem
Message ID:
003f01c19e11$138e2580$d502a8c0@swbell.net
I setup sendmail to forward mail for a specifc addy to my PERL script.
I can't figure out how to match the blank line between the header and the
body of the message, though.

I got ?^$? from an example in the perlop man page, but it doesn't seem to be
working.
Does anyone have a suggestion?  Below is the block of code in question:

# Allow filename to be used instead of STDIN for debugging purposes
open (STDIN, $ARGV[0]) if (($ARGV[0] ne "") && ($ARGV[0] ne "-"));

$msgbody = 0;

@mail = <STDIN>;
for $mail (@mail)
{
  if ($msgbody == 1)
  {
    $count = @body;
    @body[$count] = $mail;
  } else {
    $msgbody = 1 if ($mail =~ ?^$?);  #Find Blank Line After Header
  }
}

Thanks in Advance
Sheridan Saint-Michel


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About