3 ms·
Which is why I've always stuck to `perl -pi -e`. It may not be as powerful but it's just one thing to learn. Also it understands regexs like '\d', etc which ar
by superasn 5y ago
Which is why I've always stuck to `perl -pi -e`.
It may not be as powerful but it's just one thing to learn. Also it understands regexs like '\d', etc which are kinda universal but for some reason don't work with many of these utils.
- mdaniel 5y agoI also read once that perl was the most ubiquitous tool across all Unixen flavors, but I don't have a link to cite for it
- gnubison 5y agoPerl is certainly more powerful than sed or awk :)
- kbenson 5y agoI wouldn't call having the de-facto standard for an advanced regular expression system, a full programming language and the entirety of the CPAN module system easily pulled in and used less powerful. I use sed for a lot of simple stuff, but I use Perl all the time for more advanced stuff. Perl is great for grabbing complex chunks out of a line and doing something with them that requires a bit of state. For example, writing a quick and dirty logfile parser to figure out how many requests and how many bytes were used by each IP over a time period (the time period limiting usually being a prior grep before being passed to Perl). I've probably taken 60 seconds to write out something to parse exactly what I want from a log hundreds of times.