from Hacker News

Ask HN: Is it still a good idea to learn Perl for a young developer?

by not-so-darkstar on 6/15/25, 9:28 AM with 27 comments

  • by brtastic on 6/17/25, 2:50 PM

    Yes. Perl will give you incredible power and you will have a lot of fun in the process.

    First and foremost, it is great for writing scripts. It is much more civilized and faster than bash. If your script does anything more than calling a couple programs, writing it in Perl is a good idea. It has almost instant startup time, unless you use some heavy modules.

    Secondly, its one-liners are very capable and can efficiently solve problems you would normally solve by a mixture of bash, sed and awk. Once you learn regexes it can mung text more efficiently than any other tool.

    Lastly, if you wish so, it can scale up so that you can write full-blown applications in it. It is good for all kinds of backend tasks with the help of CPAN modules. As a bonus, any application you write should last you for a very long time, since both the interpreter developers and the community in general take preserving backward compatibility seriously.

    Please note that a bit older technologies like Perl don't generate as much noise to get excited about. There is no new language feature, library or framework announced every month. Instead you can start investing early into your future by writing personal programs in it that will likely last you a lifetime and will not require constant tweaking as the ecosystem changes. Perl interpreter is not a "moving target", and many established CPAN libraries aren't either. It's a solid platform to develop stable, useful software.

  • by AnimalMuppet on 6/15/25, 7:55 PM

    Perl is interesting because it was written by a linguist. It's the only language I know of where you can say "it".

    Here's what I mean: I'm talking to another developer. I say, "Read in a line of input. If it ends in a newline, remove the newline." I can talk like that to a developer.

    But when I talk to a computer, it says, "Read in a line of input? From where? And put it where? If 'it' ends in a newline? If what ends in a newline?" You can't talk to a computer that way...

    Except in Perl. In Perl, you say, "Read in a line of input. I didn't specify where, so read in from the standard place[1]. I didn't specify where to put it, either, so put it in the default variable[2]. Then call chomp, which if I don't specify, will operate on the default variable."

    [1] The default input is the files specified as command-line arguments, in order.

    [2] The default variable, $_, is used when you don't specify a different variable. $_ plays the linguistic role of "it" - it's what you're talking about when you don't specify what you're talking about.

  • by hiAndrewQuinn on 6/15/25, 1:10 PM

    (I'm assuming you mean the latest Perl actually called Perl, and not its successors.)

    In a vacuum I wouldn't recommend Perl over first learning the most common languages and technologies of today. I'd gain some familiarity with Python first at a minimum. But it does have some interesting niche advantages you might want to look into more down the road.

    Perl 5 has been on the same major version for 30 years now [1], and hence has had a truly enormous amount of training data for LLMs to glomp onto. Since Perl is also primarily thought of as a "scripting-plus" language, something to reach for when Bash isn't cutting the mustard but a 'real program' feels too heavyweight, a lot of its use cases are very much in the LLM one-shot sweet spot. [1]

    Perl 5 also has the unique advantage of being installed system-wide by default on more Unix machines than you might expect. It's sitting there quietly on Debian for you right now [2]. It's even the scripting-plus language of choice for OpenBSD!

    You would think being "the same" for 30 years would also mean Perl almost accidentally performs really well on modern machines, which have a few orders of magnitude more resources to throw around. I haven't really found this to be that noticeable, though, and if I actually cared about performance in those domains I'd probably stick to the smallest tools I could work with first. Then again, a vanilla Perl 5 program might be even more cross-platform than a vanilla shell script is; shells come and go, but Perl 5 is forever, apparently.

    [1]: https://hiandrewquinn.github.io/til-site/posts/llms-make-per...

    [2]: https://hiandrewquinn.github.io/til-site/posts/what-programm...

  • by gbacon on 6/18/25, 12:52 AM

    If you’ll be spending a significant amount of time around Unix or Linux as a sysadmin or developer, it’s definitely worth learning. Like vi, it will always be there. Larry Wall characterized Perl as inhabiting the void between the manipulexity of C and the whipuptitude of the shell. When your shell script starts to run out of gas, switch to Perl. For quick text filters or one liners dealing with code or other collections of files, Perl’s keystroke-to-horsepower ratio is challenging to match. Some you use frequently enough that they’re worth tossing into your ~/bin to run from the command line or as a filter inside vi.

    It’s refreshing to see an even-handed discussion in the replies here rather than the usual hurr hurr punctuation language bigotry. Perl is a big language. Perl is a quirky language. Perl is a fun language. Perl is an extraordinarily well documented language.

    Perl is a different language. The urge among programmers to conform is surprisingly strong. Even computer geeks seem to want to get their kicks bullying the weird kid. In comparison, Python and Java code look so bland, so boring. But the market has clearly decided, and Perl has paid the price for daring to be unorthodox.

    The superficial demands of orthodoxy make it an inexpensive substitute for virtue. And that in turn is one of the reasons orthodoxy is so attractive to bad people. You could be a horrible person, and yet as long as you're orthodox, you're better than everyone who isn’t.

    https://www.paulgraham.com/heresy.html

  • by ccashell on 6/20/25, 7:41 AM

    It can definitely be worthwhile.

    First, Perl takes some unique approaches to programming language design, and that will stretch your brain and make you a better programming. New concepts and ideas (to you), particularly ones with a long and proven record, are almost always worthwhile.

    Secondly, Perl is incredibly useful. It's still my go-to choice for a most things that need more than can easily be done as a shell script, but don't have a specific reason why I should use a different language. I find that Perl is more fun to code, and it's incredibly efficient for getting things done. If you're doing anything that involves text processing, Perl is still king, IMO.

    One note: Perl style shifted significantly about ~15 years ago with the "Modern Perl" movement. This was a good thing, and you should ensure that any books or articles that you work with take advantage of those modern approaches. This can largely resolve the "write-only" complaints that some people have about Perl. Which, to that point, I'll note that it is very easy to write very readable and easily maintainable Perl code. Use a recent version of Perl and make sure you always have strict and warnings enabled!

    Also, if you're wanting to do OO, check out Moose, Moo, or Perl's newly released OO class system.

  • by perlcommunity on 6/17/25, 2:25 PM

    It follows when someone discovers Perl,

    "Yes, we know it's nothing new It's just a waste of time We have no need for ancient ways The world is doing fine

    Another toy will help destroy The elder race of man Forget about your silly whim It doesn't fit the plan.

    I can't believe you're saying These things just can't be true Our world could use this beauty Just think what we might do.

    Listen to my music And hear what it can do There's something here as strong as life I know that it will reach you.

    Don't annoy us further We have our work to do. Just think about the average What use have they for you?"

    -Rush, 2112

  • by dapperdrake on 6/15/25, 1:03 PM

    Depends on your use-cases.

    Perl went through a few backwards-incompatible changes and Raku (née Perl 6) and has eroded its library base and user base.

    Kind if like the transition from Python 2 to Python 3 stranded part of the ecosystem.

    The backwards compatible systems like Linux user space ABI, Java (ruffled feathers with Java 9), TeX/LaTeX and Win32 will stick around the longest due to accreting libraries. Golang is on its way there. Python 3 may have enough important libraries now to also stick with them. If Zig does their job right, then they also have chances.

    For Java look at NTS from Java 1.2 days in 2001, where apparently even the old jar files still load on new JVMs: https://news.ycombinator.com/item?id=40753417

  • by RichMiller6 on 6/18/25, 4:12 AM

    Perl is a great language to have in your toolbox! It lets you create functionality with surprising speed compared to Algol-style languages (C/C++, Fortran, etc.), and runs quickly enough to handle a wide variety of problems. You can learn enough Perl in a few days to write powerful tools; unlike, say, C++, the stuff you don't know won't hurt you. For manipulating text - something programmers do all the time - Perl is unsurpassed.

    Perl supports reflection so well that the perl debugger is just another perl script; if you need to override core functions, you can. CPAN - the Comprehensive Perl Archive Network (https://www.perl.org/cpan.html) has 25,000 modules for download.

    Most importantly, given the question about whether it's a good idea to learn Perl for a young developer: Perl feels different from the other languages you'll encounter. It gets lots of power from a small set of core features, and these are generally designed to be orthogonal in the sense that you can combine them in obvious ways and get what you expect. I've heard many people say things like, "Perl put the fun back into programming."

  • by sandreas on 6/15/25, 1:04 PM

    Perl is a nice language that can do a lot of things very well.

    However, for landing a job or doing more modern stuff like AI or web, I'd probably recommend

      Python
    
    as a first language, unless there is a specific reason to learn perl
  • by brudgers on 6/15/25, 7:50 PM

    Yes, because it does not matter what language a young person learns.

    Or an old person.

    Learning is a skill acquired through experience.

    It is not an optimization problem.

  • by rl1987 on 6/15/25, 4:07 PM

    No-ish, unless you specifically want to work with Perl codebases (e.g. in bioinformatics). By and large, Python has pretty much replaced Perl for generic scripting work.
  • by rus20376 on 6/17/25, 3:24 PM

    Yes, absolutely!

    At one point it made sense for everyone to learn Perl because it was the de facto scripting language for server side components of the, then brand new, World Wide Web. Nowadays backend software development and other Perl niches like shell scripting are crowded with competitors. But that does not invalidate Perl in the least! Indeed, Perl is still the best "power tool" available to a systems programmer, system administrator, or anyone working in the realm of "shell scripts".

    Learn Perl because it is the most powerful way to write scripts on Linux (or any other Unix like operating system).

  • by imyaman on 6/17/25, 10:19 PM

    Yes. Perl is often found pre-installed on many systems. This allows you to use it comfortably even on unfamiliar systems, including mainframes.
  • by mindwork on 6/16/25, 11:34 PM

    No, unless you're set your eyes on woking at Booking.com
  • by aristofun on 6/15/25, 1:48 PM

    No