The substitution operator s returns the list of captured substrings or, in scalar context, the number of captured substrings, which is 1.
This isn't true. s/// always returns the number of substitutions made or the empty string if no substitutions were made (see perlop). The expression in map is in list context.
In reply to Re^2: Newbie: parentheses, map, etc.
by kyle
in thread Newbie: parentheses, map, etc.
by nefigah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |