my $cookie = 'name1,value1,name2,value2'; my %hash = split(',', $cookie);