in reply to s///g and capturing all matches
: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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: s///g and capturing all matches
by Random_Walk (Prior) on Dec 16, 2011 at 09:08 UTC |