3 ms·
Just guessing that your #4, BEGIN and END, are for using Ruby like awk (that is, from the shell—you should never see them in a script.) Try this (and cringe):
by derefr 16y ago
Just guessing that your #4, BEGIN and END, are for using Ruby like awk (that is, from the shell—you should never see them in a script.) Try this (and cringe):
cat /usr/share/dict/words | ruby -lne 'puts $_.reverse; n = (n || 0) + 1; END{ puts "total: #{ n }" }'