in reply to Map with Regex Replace
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Map with Regex Replace
by kennethk (Abbot) on Aug 08, 2013 at 14:43 UTC | |
|
Re^2: Map with Regex Replace
by Endless (Beadle) on Aug 08, 2013 at 14:01 UTC |