Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: how do i pass values entered in the textfield into a hash ?

by davorg (Chancellor)
on Jul 03, 2001 at 13:16 UTC ( [id://93445]=note: print w/replies, xml ) Need Help??


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');

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://93445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found