Two things I'd personally suggest.
One, do a non-greedy match with .*? (although I'd wonder if there's no data -- perhaps use .+? instead). Not critical, just precautionary.
And two, verify your match (this could probably be more elegant, but just to illustrate the point):
my $msg; if (/msg=(.*?) Src/) { $msg = $1; } #else { # possible error message here, whatever is appropriate #}
In reply to Re: Parsing a log file
by Nkuvu
in thread Parsing a log file
by TStanley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |