Hacker News new | ask | show | jobs
by thesuperbigfrog 1514 days ago
>> Curious - is there a reason to use Perl (Wall's latest version, 5 or whatever) in 2022 if one has no familiarity with the language? What would be the major advantage of using Perl over its closest analogues, some bastardization of Bash and Python?

It depends on what you are trying to do.

Perl excels at processing text particularly if you are familiar with regular expressions.

Perl mainstreamed regular expressions and most programming languages that support regular expressions support some subset of Perl regular expressions.

Perl is faster than both Bash and Python and scales up a bit better than Python as a project starts to grow because 'use strict' and 'use warnings' will catch many errors. Python has a better 'batteries included' standard library, so it tends to be better at prototyping than Perl unless you are pulling in libraries in which case it depends on what you are trying to do.

Perl can be more terse than Python, particularly if you are using built-in variables. However, this impacts legibility which is part of the reason why Perl is the target of 'executable line noise' jokes.