3 ms·
Perl is readable, just indent it.
by anthk 6y ago
Perl is readable, just indent it.
- nerdponx 6y agoWhat 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
- jlg23 6y agoI know, I still have my black belt in perl somewhere. The one-liner is readable, too. Throw in some needless array-referencing-and-dereferencing so people can rightfully consider perl a write-only language...