I know Perl 5. What are the advantages of learning Perl 6, rather than moving to Python?

Show Details

Solution 1: [1]

There is no advantage to be gained by switching from Perl to Python. There is also no advantage to be gained by switching from Python to Perl. They are both equally capable. Choose your tools based on what you know and the problem you are trying to solve rather than on some sort of notion that one is somehow inherently better than the other.

The only real advantage is if you are switching from a language you don't know to a language you do know, in which case your productivity will likely go up.

Solution 2: [2]

Python does not have Junctions. In fact I think only Perl has Junctions so far. :-)

Solution 3: [3]

In my opinion, Python's syntax is much cleaner, simpler, and consistent. You can define nested data structures the same everywhere, whether you plan to pass them to a function (or return them from one) or use them directly. I like Perl a lot, but as soon as I learned enough Python to "get" it, I never turned back.

In my experience, random snippets of Python tend to be more readable than random snippets of Perl. The difference really comes down to the culture around each language, where Perl users often appreciate cleverness while Python users more often prefer clarity. That's not to say you can't have clear Perl or devious Python, but those are much less common.

Both are fine languages and solve many of the same problems. I personally lean toward Python, if for no other reason in that it seems to be gaining momentum while Perl seems to be losing users to Python and Ruby.

Note the abundance of weasel words in the above. Honestly, it's really going to come down to personal preference.

Solution 4: [4]

Perl is generally better than python for quick one liners, especially involve text/regular expressions

Solution 5: [5]

Python has one huge advantage: it's implemented, there's a rather stable compiler for it.

Perl 6 (renamed Raku in 2019) is a rather visionary language, with a stable compiler and test specification released in 2015. It has a set of very cool features, among them: junctions, grammars (yes, you can write full parsers with Raku "regexes"), unicode handling at the grapheme level, and lazy lists.

In your particular case when you know Perl 5 you'll get familiar with the Raku (née Perl 6) syntax very quickly.

For a more comprehensive list of what cool features Raku has, see https://raku.org/ or alternatively, the FAQ.


This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Credit
Solution 1 Bryan Oakley
Solution 2 pi.
Solution 3 Kirk Strauser
Solution 4 Martin Beckett
Solution 5 moritz