Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: I want you to convince me to learn Perl

by HelenCr (Monk)
on Sep 25, 2013 at 05:38 UTC ( #1055610=note: print w/replies, xml ) Need Help??

in reply to I want you to convince me to learn Perl

Perl was invented and designed by a philologist (an expert in human spoken languages) - Larry Wall. This entails, that once you grasp and understand the Perl spirit and internal logic, the entire language "makes sense", you realize that its design is clean and logical, and it's fun and easy to develop in it.

An example of the philological influence: human languages have inflections. (In English, for example, nouns are inflected according to single or plural; verbs get inflected according to tense (past, present or future) etc.

In Perl, the parallel is the "sigil" system: the little sign: [$, @, %] you put in front of the variable. It signifies the "context".

So for example, if "Array" is an array, then normally you will refer to it as: "@Array", but when you refer to an array member, you have to state: "$Array[$i]".

Logic of similar power governs the referencing/ dereferencing system.

You don't have these in Python - therefore, it less fun to write, and more error-prone when engaging in heavy and complex programming.

  • Comment on Re: I want you to convince me to learn Perl

Replies are listed 'Best First'.
Re^2: I want you to convince me to learn Perl
by pobocks (Chaplain) on Sep 25, 2013 at 05:47 UTC
    I'm also a fan of Perl over Python, and I come to it from literature, so I'm actually even a fan of implicit contexts - but saying that said contexts make Perl less error-prone really doesn't match my experience or anything I've seen. It can make it less verbose for some things once you understand contexts deeply.

    Also, given the decisions made in Perl 6 about sigil invariance, it seems pretty clear that the overall drift of the language is away from heavy use of implicit context to determine what code does.
    for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
      pobocks: the Perl internal logic and language consistency are much broader and deeper than just being about implicit context.

      Like I said, when you consider together the Perl referencing/dereferencing system, together with the sigil methodology, the language becomes very powerful, clear, and unambiguous, simultaneously.

      I can bring innumerous examples.


        Please do, then - although I ask that you stick to demonstrating examples where context and sigils reduce the possibility of error, as that is what I was questioning.

        for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
Re^2: I want you to convince me to learn Perl
by kasxperanto (Acolyte) on Sep 25, 2013 at 15:04 UTC

    Kiel Esperantisto, cxi tiu trajto vere tre interesas min. Mi tre felicxas eklerni novajn lingvojn, cxu por programado cxu por parolado.

    (As an Esperantist, this feature is actually quite interesting to me. I'm very happy to learn new languages, whether for programming or for speaking.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055610]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-03-24 00:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (297 votes). Check out past polls.