3 ms·
What is the readable indented version of this? perl -anle '$w{lc s/[[:punct:]]//r}++ foreach @F; END{print map{"$w{$_} $_ \n"} (sort{$w{$a} <=> $w{$b}} keys
by nerdponx 6y ago
What is the readable indented version of this?
perl -anle '$w{lc s/[[:punct:]]//r}++ foreach @F; END{print map{"$w{$_} $_ \n"} (sort{$w{$a} <=> $w{$b}} keys(%w))}'
- faizshah 6y agoI wrote that as a one liner it’s not supposed to be readable. Here’s a readable version of essentially the same program: https://perlmaven.com/count-words-in-text-using-perl https://perlmaven.com/count-words-in-text-using-perl