I am always happy to see Perl being used in *some* unix administration tools where shell scripting logic is inefficient or insufficient. My Unix purism starts when I see Python or Java(!) being used for such tools. And what's the deal with the different versions of Python? DNF - Fedora's package manager - is written in Python. It's ok but right now I am getting random seq faults after an upgrade - I do not know where to start debugging it. Totally in a loss. It is said they try to convert DNF to C and for a good reason.

I have used Perl for website scraping a lot: 1) it has quite a few user agents to choose from, even curl, for fetching the webpages, 2) it has adequate HTML parsing modules, 3) it is super easy to use a regular expression to filter your results. Sure one can do the same in Python (or Java) but using regexes there, it is so tedious, for me. Give me the ol' m//g m// (edit:ouch!) form any day.

In Perl one can inline C, which means you can run custom number-crunching routines or using external C libraries easily. So whatever deficiencies Perl has with number crunching (speed), inline C can compensate - if one is serious. There is also PDL which offers a lot of scientific computing support. And then there is Python with lots of libraries which is convenient, but I get no joy.

Perl offers Mechanize and WWW::Mechanize::Chrome for interacting with a web site via a web browser. That's really cool and can automate many menial testing tasks. (Mechanize has been translated to Python too). Add to that Perl's very good test framework and you can use Perl for lots of testing.

And then you have website backends. Once it was mostly Perl. Now there is a lot of php (last days of Rome anyone?) and possibly some Python. But there is joy in using Perl as a backend which also supports templates. (A totally subjective and personal view from my one-time experience).

You say Python or R. But they have very little overlap. Sure you can multiply two matrices in Python as you can in R. But I will not say it is "one or the other" but "one and some of the other" or just the "other".

Each programming language has its own culture. If you want to be happy programming in that language make sure you are happy with the culture. The critical question for you would be "Are you comfortable with many ways to do one thing? Or would you rather prefer there was just one way?". Answer that and you will answer your question.

P.S. Look mumy I haven't slanted Python today!

bw, bliako

In reply to Re: Is it worth knowing Perl? Real-life examples please by bliako
in thread Is it worth knowing Perl? Real-life examples please by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.