You still didn't read perlre as recommended, did you?
"+" is a quantifier. It makes no sense as the only thing in a regexp. It has to modify something. Finding a nonsensical syntax within a regular expression will cause an error, because regular expressions are a built-in part of Perl.
If you want to match the literal character "+" you can do so by escaping it, or by metaquoting it:
s/\+/ /
# or
s/\Q+\E/ /
But you really shouldn't be parsing your own CGI parameters. Use the CGI.pm module, at least until you understand why this advice is important.
As for additional reading: The CGI.pm POD. And perlretut, and perlre, and perlrequick all provide good reading material on regular expressions, each targeting a different stage in your learning curve.
Dave
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein
|