@mdhughes Are you sure Perl is a loser here? One thing it WON'T be doing is spawning yet another processs and writing all those lines to it, just to get a line count. ffs.
@fleegman There's other stuff around it that'll live in shell, repeated a lot. Input corpus may be hundreds of lines. It needs to be a little performant.
So a new perl every call's a bad move, wc takes nanoseconds. I'd have to write the outer part also in Perl, or in that case more likely Python or Scheme, to justify launching an interpreter.
@mdhughes Well that's unfortunate. shell is a horrendous language to try to write in. The fact that you can't reduce that trivial little function to a one-liner exemplifies.
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.