Hacker News new | ask | show | jobs
by thesuperbigfrog 1982 days ago
Learning Perl is worthwhile because it is ubiquitous on Unix-like systems and Perl-compatible regular expressions are the defacto standard regular expression syntax.

Perl may not be as popular now as it was in the past, but it is still around and lots of legacy systems that were written in Perl are still in active use.

1 comments

But as Perl-compatible regular expressions are available in many other languages, this is not really a reason for learning Perl itself, right? Or am I missing some deeper insight into regexes, because I don't know Perl?
It is a matter of personal preference.

I find that regular expressions and text-wrangling tasks are faster and easier in Perl than in other programming languages due to its accessible syntax and regular expression engine speed.

This article shows the regular expression syntax in several popular programming languages: https://cs.lmu.edu/~ray/notes/regex/

This GitHub repo gives some regex performance test benchmarks: https://github.com/mariomka/regex-benchmark Perl is pretty fast among the scripting languages that were benchmarked.

If you are familiar with C / C++, then learning Perl is relatively fast and easy: https://perldoc.perl.org/perlintro

That's true, but it's worth mentioning that using the regexes in perl is quick and even fun to write. They are built-in to the language. some people find it very convenient.
Also the Perl community has been pushing the boundaries of regex and text processing generally.

If you find yourself in a place with frequent one-off text wrangling or Unix admin problems some Perl knowledge is worthwhile.