Live data from Hacker News

Ask HN: Should I learn Awk or Perl? Or is that a bad question?

news.ycombinator.com

11–20 of 37 posts

Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?

#13
The 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 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?

#14
post #13

The 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?

#15
post #14
post #13

The 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.

To me, having to be the compiler and have 100% test coverage for typos is a limit. TS is a lame, misguided attempt to correct that to let people keep using such limited languages for things.

Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?

#17
>noticing a lack of literature on Perl on the command line

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

[2] https://github.com/learnbyexample/TUI-apps

Re: Ask HN: Should I learn Awk or Perl? Or is that a bad question?

#20
post #16

Having 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.

this was my understanding as well. perl grew out of sed/awk/bash, so might as well learn perl.

that said, i found it gives a lot of 'foot-guns'.

Post reply on HN