Once in a while, our sysadmin tweaks something on an upstream mail server, and asks us a few days later if our spam rate has changed. I invariably whip up a perl5 one liner like this to get a daily spam count from my "mh" mail folder:
scan +spam|perl -naE '$d{$F[1]}++; END{say "$_: $d{$_}" for sort keys %d}' "scan +spam" spits out one line per message in my spam folder, with the date in field 1. I'm using perl in an awk-like way, and taking advantage of non-strictness to use a global %d without declaring it. What's a good concise "strict" Rakudo one-liner that works the same? In particular, is there a Perl6 one-liner that works line-by-line (not requiring reading all STDIN into memory) and doesn't require a variable declaration? -y