Front page | perl.perl6.language |
Postings from January 2010
From: Carl Mäsak
January 27, 2010 05:01
Message ID: email@example.com
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.
by Carl Mäsak