While I've seen worse form data parsers, this one doesn't handle multivalues and probably has security issues (although I don't remember why at the moment of this writing).
You can avoid this and a lot of cut+paste by using CGI; the following code replaces the one in your post, gaining named features and not losing anything:
use CGI; # use the CGI.pm module my $query = CGI->new; # create a CGI object called "$query +" # if you actually need all form data in a hash, # do this: my %formdata = $query->Vars; # get all form data in hash "%formda +ta". # does handle multivalues, although not too well; # see the CGI manual on "multivalue" for more on that topi +c. my $yip = $query->remote_host; # get the remote hostname or address # my $link = $formdata{link}; # one way of getting the link parame +ter. my $link = $query->param('link'); # another way of getting the link pa +rameter.
Cheers, Sören
In reply to Re^3: html code cleanup via GET
by Happy-the-monk
in thread html code cleanup via GET
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |