3 ms·
For me, this is the whole point of perl: You can learn one tool which replaces three, each with their own syntax: Sed, Awk, and Grep.
by dogweather 12y ago
For me, this is the whole point of perl: You can learn one tool which replaces three, each with their own syntax: Sed, Awk, and Grep.
- cogburnd02 12y agoWait, why not just use awk? It can do pretty much everything the other two do (and can, like sed, be used to replace other things (like 'head')) and runs faster than perl at some things. (https://news.ycombinator.com/item?id=8858342 https://news.ycombinator.com/item?id=8858342)
- dogweather 12y agoI learned awk in school, and like it. But I like to choose tools which increase programmer-efficiency before machine-efficiency. Perl is just one tool and one easy syntax to learn. Its regex language is now the standard as well. Only if runtime efficiency turns out to be too slow would I re-examine choice of tools. This is like avoiding premature optimization. (I've never found perl to be too slow in practice, btw.)