We may frequently need to change a pattern in a string. The substitution operator (s) is the simplest form of substitution. It has the form:
s/old_regex/new_string/
So to replace the + characters from CGI input with a space we could do:
$CGI_in_val =~ s/\+/ /ge;
We can qualify the substitution with a g global substitution, i ignore case and e evaluate right side as expression and others.
Note: cgi-lib.pl does this and other cgi character conversion automatically.