in reply to Strange Behavior while Parsing Sendmail logs

Since we don't have the entire script I am taking a guess here. I assume you are opening the log and reading through each line like so:
open FH, "mylog" etc.... while (<FH>) { do these steps }

If you have the regex you listed in the "do these steps section" then as it is written $to_addr will get assigned the entire line because you have parenthesized that part and set the precedence for the operations. You then run the regex on the line but it never gets assigned to anything again. Try moving the parens so it looks like this:
$to_addr = ($_ =~ rest of stuff);


UPDATE
Oops. Second code section is wrong as DrManhattan pointed out.

Replies are listed 'Best First'.
RE: RE: Strange Behavior while Parsing Sendmail logs
by DrManhattan (Chaplain) on Jul 19, 2000 at 19:19 UTC
    $to_addr = ($_ =~ rest of stuff);

    That will set $to_addr to either 1 or 0 depending on whether the substitution succeeded or not.

    -Matt