[tpm] Larry was only joking

Quantum Mechanic quantum.mechanic.1964 at gmail.com
Sat Oct 10 19:53:28 PDT 2009

While wasting time today, I visited the Wikiquote page for Larry
Among the numerous gems was this one:

Hey, I had to let awk be better at *something*...

The awk in question looked like this:

: awk is much better than perl at one-line summations:
> :       awk '{t += $1} END {print t}'

Which was followed up by this:

: With perl you can say
> :       perl -ane '$t += $F[0]'
> : but you have no way of tacking on an END clause.

Now, that was a long time ago, so it may have been true then. But certainly
not anymore, and not for a long time:

perl -lane '$t += $F[0] }{ print $t'

Not that I'm trying to golf it, but that seems reasonably simple (especially
compared with the attempts in the original thread).

I first saw this idea in a Usenet post by Abigail on how to write wc in

perl -pe '}{$_=$.'

[The '}{' seems to be called the "Eskimo Greeting".]

Quantum Mechanics: The dreams stuff is made of
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20091010/7b2a023c/attachment.html>

More information about the toronto-pm mailing list