my ($type, $restofstring) = /^type=(\w+) (.+)$/; for $restofstring(split){