4 ms·
That might be true culturally, but it's not true technically. Once you know a bit of Perl (including some command line switches like -e, -n, -a, -l, -p, and -i)
by jph00 3y ago
That might be true culturally, but it's not true technically. Once you know a bit of Perl (including some command line switches like -e, -n, -a, -l, -p, and -i) you will be able to do just as easily everything you used to do in awk and sed, but with a more powerful foundation so you have the flexibility to go further.
- imiric 3y ago> but with a more powerful foundation so you have the flexibility to go further. The question is: should you? I like Perl, but it itself has many warts that make maintaining a large codebase more of a nightmare than using C, and certainly more than most modern languages. I agree with other commenters here that the tools Perl sought to replace are still used more than it. It has its niche of being excellent at text processing, and more capable than shell scripts at that task, but I'd think twice about reaching for it to build anything more complex than a shell script replacement. Especially in 2023.
- whateveracct 3y agoWhat's a good resource to be proficient in perl for shell scripting? I write a lot of bash for better or worse. I wonder if perl would be a better choice sometimes.
- 878654Tom 3y agoIf you can't manage it with Shell scripting you should take a look at Python. I've written Perl for many years but in the end switched to Python because the internet and resources you can find are much more quantitative and qualitative than those for Perl. Especially now when Google doesn't seem to return older results anymore.
- cutler 3y agoWorse Is Better syndrome.
- whateveracct 3y agoI'd rather write perl tho
- cutler 3y ago"Minimal Perl" by Tim Maher is unrivaled for this.
- kagevf 3y agoThank you for mentioning that book - I'm very interested in how perl can replace awk and sed and even grep(!) - I use grep multiple times a day, awk maybe a few times a week, and sed very rarely. I think I'm in the target demographic for this :)