http://qs321.pair.com?node_id=11123155

netizen has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I've visited in this forum in the past once in a while as back then I used to write some small scripts. Always preferred Perl over Python.

My question is not sarcasm, nor am I trying to troll you esteemed monks. It is a genuine question. This is a forum where most of you are quite mature and understanding folks and therefore I am hoping I will not be admonished for asking this question.

The question is, considering the current job scenario, especially in the automation field, do you guys think it makes sense to learn Perl or Python? I see the internet rife with articles stating the decline of my favourite language, and I also see a lot of demand for Python but not for Perl and therefore I ask this question - In today's job scenario, would it make sense to learn Perl? Are there any jobs available in Perl? Ofcourse knowing both Perl and Python would be great, but, I would rather start with 1 language, know it really well before I make the jump.

Or, would it now make sense to learn Perl as there's lesser folks into Perl than earlier so it will be sort of a niche skill?

Please do guide me.

Replies are listed 'Best First'.
Re: Request your guidance. Please do not take it otherwise.
by marto (Cardinal) on Oct 25, 2020 at 19:07 UTC

    "do you guys think it makes sense to learn Perl or Python?"

    Why not both? Seriously, there's no sense limiting yourself to one thing. The right tool for the right job, the right tool for the right employer, there's much to consider but in terms of career prospects don't limit yourself to one thing. Learn the fundamentals of computing, learn to solve problems, you can then use whatever language best fits the situation (company, team, task....). From a few days ago Programming language Python is a big hit for machine learning. But now it needs to change, accept that change happens, in some fields more than others.

Re: Request your guidance. Please do not take it otherwise.
by jo37 (Deacon) on Oct 25, 2020 at 18:32 UTC

    It really depends on the purpose. I cannot tell anything about chances of getting hired as a Perl programmer. Being paid to administer and develop Java applications, my point of view is certainly different from a real Perl developer or someone who programs applications in another scripting language. My field of application for a scripting language is first and foremost maintenance. I need to analyse log files and I need to test applications on a semi-automated base. With some knowledge of Python and Ruby I'm quite certain that these are not suitable for my tasks.

    So I'd say: If you want to learn a universal, multi-purpose, multi-paradigm scripting language (or as Larry Wall calls it, a "postmodern language"), go for Perl. OTOH, if you want to pick a language to get a job as a developer in this very language, I have to remain silent.

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
Re: Request your guidance. Please do not take it otherwise.
by eyepopslikeamosquito (Archbishop) on Oct 26, 2020 at 00:33 UTC
Re: Request your guidance. Please do not take it otherwise.
by tobyink (Canon) on Oct 25, 2020 at 18:35 UTC

    I know it's hardly the most scientific survey, but Perl has jumped from #19 to #11 on the TIOBE index in the last twelve months. It's on the way up again. And Perl 7 and Cor are two projects on the horizon that could inject some more vitality to the community in the next year or two.

Re: Request your guidance. Please do not take it otherwise.
by jcb (Parson) on Oct 26, 2020 at 02:50 UTC

    Having used both Perl and Python, I will suggest learning Perl first. There are fewer places in Perl where you can inadvertently write something other than you intended.

    For one quick example, variables in Python spring into existence (in the current lexical scope) when first assigned. In Perl, (under use strict;) variables must be explicitly declared. This combines with Python's indentation-based block structure to create situations where you can produce a new variable instead of assigning the variable you intended. In Perl, block structure is explicit, using { and }, so those beginner mistakes are more easily caught by the compiler. Even with no strict; and using global variables, Perl is less confusing here, because global variables span the entire package, so you at least will not accidentally create new lexicals, as you can in Python.

    Overall, Python and Tcl are more easily embedded than Perl, and tend to be used to script larger systems. Embedding the Perl interpreter has historically been somewhat difficult, and Perl tends to be used for freestanding programs as a result. Perl has a significant presence in automating minor system administration tasks, which was one of Perl's original motivations.

    Learning Perl is a huge mountain to climb, but once you have reached that peak, other languages are easier to learn.

    My other not-so-big-secret is GNU Emacs. It is an extremely powerful programmer's editor once you learn its unusual commands. Emacs' CPerl mode has been a significant assistance for me for many years now.

Re: Request your guidance. Please do not take it otherwise.
by AnomalousMonk (Archbishop) on Oct 25, 2020 at 18:16 UTC
Re: Request your guidance. Please do not take it otherwise.
by hippo (Bishop) on Oct 25, 2020 at 21:29 UTC
    In today's job scenario, would it make sense to learn Perl?

    Yes.


    🦛

Re: Request your guidance. Please do not take it otherwise.
by perlfan (Vicar) on Oct 25, 2020 at 20:37 UTC
    Growing up I was always told if you want to be a great lawyer or medical doctor, learn Latin and Greek - if for no other reason it sharpens the saw and keeps your edge honed. Perl not only serves a similar purpose, but you'll end up learning a lot about *nix: file systems, shell scripting, networking, process management, etc. Most of all it will get out of your way and let you do what you really need to do. I don't know of any other programming language that provides this to the dedicated student. And if you know Perl, you can learn PythonJavaScriptPHPetc in a matter of minutes. I can't say it works the other way.
Re: Request your guidance. Please do not take it otherwise.
by soonix (Canon) on Oct 25, 2020 at 20:52 UTC

    For me, the answer is more or less the same as to the question why (or wether) you should learn Esperanto.

    Certainly not because of the huge number of people/companies using it.

    • Both languages are sometimes discredited, yet (or because of this) the community is more helpful than those of other languages,
    • and sometimes more capable of helping, too, because most users know more than this one language.
    • Besides, both languages helps you thinking different, and therefore more flexible than you would without it.
Re: Request your guidance. Please do not take it otherwise.
by LanX (Saint) on Oct 25, 2020 at 18:01 UTC
Re: Request your guidance. Please do not take it otherwise.
by karlgoethebier (Abbot) on Oct 25, 2020 at 18:17 UTC

    LanX is always right. At least 99%. Hence Make it So. Learn Perl. See also and jump to a conclusion. Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re: Request your guidance. Please do not take it otherwise.
by jmlynesjr (Deacon) on Oct 26, 2020 at 00:28 UTC

    Domain knowledge is at least 50% of a programming job regardless of the language. Do you know accounting, biology, control theory, a specific product(Linux, Oracle, Cisco) etc.?

    James

    There's never enough time to do it right, but always enough time to do it over...

Re: Request your guidance. Please do not take it otherwise.
by netizen (Novice) on Oct 26, 2020 at 23:34 UTC

    Hi Monks,

    Thank you for the answers.

A reply falls below the community's threshold of quality. You may see it by logging in.