in reply to Parsing a log file

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 #}