- The
\s
is a character class and not a valid escape for strings. The second part of a substitution is taken as a string. - To replace all occurrences (“globally”), use the
/g
switch on the replacement. - Single-character transliterations can also use the
tr///
operator.
Assuming you want to replace +
by a space:
tr/+/ /;
or
s/\+/ /g;
If you want to decode URLs:
use URL::Encode 'url_decode';
my $real_filename = url_decode $file;
See the documentation for URL::Encode for further information.