Would you want to use something else for that, maybe .comb? From the spec:
'The comb function looks through a string for the interesting bits, ignoring the parts that don't match. In other words, it's a version of split where you specify what you want, not what you don't want.' chris On Jan 27, 2010, at 7:08 AM, Mark J. Reed wrote: > What does trans return in numeric (+) context? > > On Wednesday, January 27, 2010, Carl Mäsak <cma...@gmail.com> wrote: >> How is "character counting" done in Perl 6? >> >> In Perl 5, it is `scalar tr/CG//` if I want to count the number of Cs >> plus the number of Gs in a string. >> >> S05 describes tr/// in terms of the .trans function, a handsome but >> very different beast. Specifically, it doesn't seem to have a "scalar >> context", with which one could count things. >> > > -- > Mark J. Reed <markjr...@gmail.com>