in reply to Strange Behavior while Parsing Sendmail logs
Just in case this isn't clear yet, it isn't that the mentioned part of the regex is matching the whole line, it is that the regex is failing and no substitution is taking place
It does no good to have an unanchored .* at both ends.
This looks like one of the regex optimizer bugs. You should post it to comp.lang.perl.moderated or submit it with perlbug.
I'd write this:
if( $_ =~ / to=([^,]+), / ) { $to_addr = $1; } else { warn "Unmatched to= in line: $_"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Strange Behavior while Parsing Sendmail logs
by Anonymous Monk on Jul 19, 2000 at 05:45 UTC | |
by tye (Sage) on Jul 19, 2000 at 06:44 UTC |