my %hash = split /=|\b(?=\S+=)/, $data; $hash{$_} = [ split / /, $hash{$_} ] for keys %hash;