See Regexp-Quote-Like-Operators. s/// returns the number of substitutions made. The /r option makes it return the modified string, but it's "only" available since 5.14 I believe.
As a workaround for an older Perl, consider
map { (my $foo=$_)=~ s!.*/!!; $foo } ...
or, in your case, consider File::Basename or Path::Class.
In reply to Re: Map with Regex Replace
by Corion
in thread Map with Regex Replace
by Endless
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |