4 ms·
i no longer use it but Perl was always the better solution when one thought AWK was the answer. Perl will do those things where AWK really shines and if the pr
by melling 5y ago
i no longer use it but Perl was always the better solution when one thought AWK was the answer.
Perl will do those things where AWK really shines and if the problem got bigger, Perl was easier to deal with.
- tyingq 5y agoI found that to be the case many times as well. But awk also often outperforms Perl, especially mawk.
- Scarbutt 5y agoYes but you can't learn perl as quickly as you can learn awk.
- jfk13 5y agoThough you can learn just enough perl to do awk-like things fairly easily. And then grow from there as needed.
- throwawayboise 5y agoIDK. On my OpenBSD system the awk man page is under 500 lines, and it pretty much covers the subject. I've tried to get started in Perl a few times, and just found it weird. It doesn't click. Awk is kind of weird too but it's so simple it doesn't matter. I'm sure I would eventually get Perl if I had to use it. But for me, awk and sed and shell scripting have covered my needs.
- coliveira 5y agoThe problem is that awk is a very simple language, which you can learn in an afternoon. Perl is a very complex language, and is not used anymore, so you're just spending your time on something you'll rarely use.
- forinti 5y agoIf you work a lot with Linux, you can pretty much count on Perl and awk always being there. So it comes in quite handy to know them.
- mhd 5y agoThe part that's equivalent to what you'd use for your regular awk isn't very different. Sure, you can do full-scale OO programs, but that doesn't have a large impact on small string munging. I get that you might not learn it to fluff up your CV. Also, it's usually the same kind of Perl, so you don't have to worry about whether awk is the "one true" one, or mawk, or gawk...
- sigzero 5y agoPerl is very must still used. lol
- thesuperbigfrog 5y ago>> Perl is a very complex language, and is not used anymore, so you're just spending your time on something you'll rarely use. Perl is no more complex than Python, Ruby, or Powershell. If you use any of those you can be productive with Perl in a few hours. Perl is still used, it is just not as popular as it was in the past. Do you use Git? Parts of it are written in perl. Large parts of Git were originally written in Perl, but have been migrated to C over time.
- chasil 5y agoOpenBSD's binary package system is written in perl.
- throwawayboise 5y agoProbably as much for legacy reasons as anything else. Perl was the chosen scripting language for utilities, it works, they understand it, and they've kept with it. Sort of how they stay with CVS for their source repository. Python isn't even installed on a base OpenBSD system.
- zeteo 5y agoPerl was built initially as a sed/awk killer but got distracted into trying to take over the world. The interpreter for a language with 100x the number of features will always be slower. Also there's a very clear boundary for when I should use awk by itself, as part of a pipeline, or switch to a better tool. I feel like Perl has the potential to suck me imperceptibly into a huge mess where I spend 80% of my time refactoring everything.
- fomine3 5y agoDid you have ever found that a Perl oneliner is slow so rewriting by awk meaningful?