Sure. Read up on and make liberal use of the CGI perl module -- it allows you to retrieve the information intact quite magically as shown below...
$usertext = $cgi->param('sometextarea');
e-mail neshura | [reply] [d/l] |
This cannot be overstated. Until you know why you don't
need CGI.pm, always use CGI.pm.
| [reply] |
Read the above, but as far as your example code,
don't forget your 'g' at the end of your regexp so
that you replace more than one "plus"...
$var =~ s/\+/ /g;
Even better, just use the 'tr' function:
$var =~ tr/+/ /;
For the record, the pluses should be escaped by the
browser into "%2B", and you should not have to worry
about the user's pluses.
| [reply] [d/l] [select] |
Or instead of subs on each one of the special values (like %20, or %2B), you can try this:
s/%(..)/pack("C", hex($1))/eg;
Actually, forget the above and go with CGI.pm. Its much easier...
| [reply] [d/l] |
| [reply] [d/l] |
Using CGI.pm would seem to be especially important in this case. I do not mean this as an insult at all, but if you didn't know about the translation of the plus character, you probably don't know about the other weirdness of encoding used for GET method form submissions. CGI.pm can translate it seamlessly. While understanding the protocol is very useful, true understanding usually leads to the knowledge that it's a pain to implement. | [reply] |