perl is more of a completely replacement for sh+awk for a standalone script/program. it was the first scripting language i know of that could do sockets networking and other complex things you'd previously need to write in c. it has extremely powerful text processing capabilities, like awk. but it's a big complicated, unusual scripting language. if you want a big complex full-featured scripting language to make a complete tool these days, why not use Python? if you only need really fancy text manipulation, maybe Perl, but i don't see that use a lot.
[1] https://www.gnu.org/software/gawk/manual/html_node/index.htm... [2] https://awk.dev/
I have written a book on Perl one-liners with plenty of examples and exercises [0]. I've also written books on CLI text processing tools like grep, sed, awk and coreutils [1]. If you prefer just solving exercises, check out my interactive TUI apps [2].
>Is awk just better for this use case?
It depends on the kind of tasks you'd need to solve. I generally prefer grep, sed and awk first. Perl helps if I need powerful regexp and other niceties like the huge number of built-in functions and access to third-party libraries.
[0] https://learnbyexample.github.io/learn_perl_oneliners/
[1] https://github.com/learnbyexample/scripting_course#ebooks
Searching for 'perl one liners' and the related term 'perl golf' gives many articles and books:
https://www.perl.com/article/perl-one-liners-part-1/
https://www.perl.com/article/perl-one-liners-part-2/
https://catonmat.net/perl-one-liners-explained-part-one
https://catonmat.net/perl-one-liners-explained-part-two
https://catonmat.net/perl-one-liners-explained-part-three
https://catonmat.net/perl-one-liners-explained-part-four
https://catonmat.net/perl-one-liners-explained-part-five
https://catonmat.net/perl-one-liners-explained-part-six
https://catonmat.net/perl-one-liners-explained-part-seven
http://novosial.org/perl/one-liner/
https://www.oreilly.com/library/view/perl-one-liners/9781457...
So you can start by spending 20 minutes to learn awk, and then spend 20 years to learn Perl (and use awk in the mean time)
Perl was inspired by awk, not the other way around. Perl is more general purpose.
The issue with awk is that there are multiple non-interoperable implementations:
https://en.wikipedia.org/wiki/AWK#Versions_and_implementatio...
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-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/ and perl mason 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:
If you want more information about running Perl on the command line then start with https://perldoc.perl.org/perlrun (or `perldoc perlrun` in your shell)
For perl… not sure. I learned a bit of perl in high school and never had a chance to use it, even at work where i occasionally see it being used from other people.
Perl is more powerful but learning and remembering all (or a sufficiently more powerful superset of awk's capabilities) of it is going to take time. The peculiarities of its syntax is certainly not a small set.
All of awk on the other hand needs about 2 hours, if you have done some programming before.
Why Perl gets such a bad rap, then? I'll tell you.
I've used Perl for almost 30 years now, and I've never found any limits in the tool. This means every limit I found was _mine_. Many programmers feel bad when they find their own limits, but it doesn't have to be the case.
You should be OK with finding your own limits, and be willing to overcome them, and strive to become a Perl power user, just like the founder, Larry Wall.
If you choose this, to grow and improve and be better, and better, and better, then Perl is the best option.
It's up to you.