$_ = 'Jul 15 15:12:10 a=foo time="2004-07-14 01:20:25 UTC" b=abc@foo.com msg="^one can say anything here except quotes$"'; my ($timestamp,%pairs) = split(/\s+(\w+)=/); print "Timestamp => $timestamp\n"; print "$_ => $pairs{$_}\n" for (sort keys %pairs); __OUTPUT__ Timestamp => Jul 15 15:12:10 a => foo b => abc@foo.com msg => "^one can say anything here except quotes$" time => "2004-07-14 01:20:25 UTC"