in reply to How do I pass values entered in the textfield into a hash?
Assuming that you've already used CGI.pm and declared the hash. And also that the text field is called hashdata...
foreach (split /,\s*/, param('hashdata')) { my ($k, $v) = split(/=>/); $hash{$k} = $v; }
If you know the hash is going to be empty at the start, then it gets a bit simpler...
%hash = map { split /=>/ } split /,\s*/, param('hashdata');
|
|---|