Ask HN: Should I learn Awk or Perl? Or is that a bad question?
11–20 of 37 posts
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#12use Python, so that other people can read it
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#13Why 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.
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#14The case for Perl is just that it has no limits. You will never run out of tool if you go with Perl. That is what, I believe, makes the investment worthwhile. 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…
I wonder if AI will make limitless languages easier to work with and maintain.
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#15The case for Perl is just that it has no limits. You will never run out of tool if you go with Perl. That is what, I believe, makes the investment worthwhile. 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…
This is good insight. Limits are often built into programming languages. Java is all about the limits. TS's selling point is literally the limits. As well as every opinionated language. I wonder if AI will make limitless languages easier to work with and maintain.
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#16Perl was inspired by awk, not the other way around. Perl is more general purpose.
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#17I 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
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#18Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#19So 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)
Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?
#20Having learned both at an intermediate level, I use awk for structured data handling, Perl for textual pattern matching. Perl was inspired by awk, not the other way around. Perl is more general purpose.
that said, i found it gives a lot of 'foot-guns'.