3 ms·
Perl is far more capable than awk and more portable. The issue with awk is that there are multiple non-interoperable implementations: https://en.wikipedia.org
by thesuperbigfrog 2y ago
Perl is far more capable than awk and more portable.
The issue with awk is that there are multiple non-interoperable implementations:
https://en.wikipedia.org/wiki/AWK#Versions_and_implementations https://en.wikipedia.org/wiki/AWK#Versions_and_implementatio...
https://stackoverflow.com/questions/40409632/what-is-the-difference-between-the-different-awk-versions#43590842 https://stackoverflow.com/questions/40409632/what-is-the-dif...
This makes awk scripts less portable than other text processing tools.
awk is also not extensible--it can be awkward (heh) to adapt it to some problems and big scripts get difficult to wrangle.
awk is great if your text processing problem is small.
Sometimes small problems grow in which case Perl tends to be a better choice:
https://stackoverflow.com/questions/366980/what-are-the-differences-between-perl-python-awk-and-sed#367014 https://stackoverflow.com/questions/366980/what-are-the-diff...
People love to hate perl, but there is a reason why it was installed on all Unix and Linux systems by default and was so popular for web servers on the early Internet (e.g. Apache mod_perl https://perl.apache.org/ https://perl.apache.org/ and perl mason
https://www.perl.com/pub/2002/12/11/mason.html/ https://www.perl.com/pub/2002/12/11/mason.html/ ).
Perl also popularized regular expressions as a standard component of programming languages so much that "Perl-compatible regular expressions" are probably the most widely-used regex flavor versus POSIX or other regex variants:
http://www.pcre.org/ http://www.pcre.org/
https://en.wikipedia.org/wiki/Regular_expression https://en.wikipedia.org/wiki/Regular_expression
- srean 2y ago> but there is a reason why it was installed on all Unix and Linux systems by default AWK has that one covered fair and square, even BusyBox has AWk.