:D Because m// and s/// are different operators that behave differently :D
s/// always returns the number of matches, unless you use /r, in which case it returns a string copy see perlop#s/PATTERN/REPLACEMENT/msixpodualgcer
my @c; s/(...)/ push @c, $1; q[X]; /ge
In reply to Re: s///g and capturing all matches
by Anonymous Monk
in thread s///g and capturing all matches
by Random_Walk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |