Slashdot Mirror


Perl Turns 25

Several readers sent word that the Perl programming language turned 25 today. In his commemorative post at the Perl Foundation's website, mdk wrote, "So what does the future hold for Perl? Well I don't have a crystal ball but I cannot see the language fading from usage in the next quarter century, the truth of the matter is that even though there are languages that can do some of the things that Perl does, some of them do some things better, others do things Perl wasn't designed for, there is no language that has been designed to do the things that Perl is very good at doing. No language in the current scripting languages seems to have the flexibility, maturity and extensibility of Perl. The main power of Perl has always been its ability to quickly adapt, and be adapted, to suit purposes. ... The greatest challenges we will face for Perl is a shifting end-user base that will become more reliant on devices that are feature focused but crippled in application choice, the rise in mobile devices will continue and Perl will need to evolve to work with that. A better challenge for us to face would be the integration with electronically aware, and connected devices and systems, the apocryphal internet of things, in this Perl could be a powerful tool. I also believe that the more we see a divergence of language uses in the other scripting languages the more they will face issues in their core designs, issues that Perl avoids due to its malleable nature, what some believe is the crippling factor for Perl is likely to be its saving grace as it has the power and flexibility to cope with the shifting goalposts of an increasingly technologically reliant world."

27 of 263 comments (clear)

  1. Recent convert by DCFusor · · Score: 5, Interesting

    I recently became a fan of perl as my goals changed towards things it excels at - sticking together big other functionalities easily.

    --
    Why guess when you can know? Measure!
    1. Re:Recent convert by vlm · · Score: 5, Insightful

      AKA I'm a CPAN programmer not a Perl programmer. Works for me! Wake me when another language has the depth of CPAN. I might switch, then. Maybe.

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    2. Re:Recent convert by DCFusor · · Score: 5, Interesting

      Yup. Me too. It's just awesome to be able to get stuff from CPAN with about the right "chunkiness" and documentation vs say trying to learn some huge monolithic library. Better yet - those cool modules often "accidnetally" document other things, like say, Gnuplot, so you can roll your own specialized versions easier than trying to understand the "native language" dox written by someone who didn't code in some other language, then translated by another non-programmer. And I can't believe I got first post.

      --
      Why guess when you can know? Measure!
    3. Re:Recent convert by Anonymous Coward · · Score: 3, Informative

      RubyGems is very expansive, but the quality of the modules that rubyists write is atrocious. The language is such a poor performer (spend 30% of the time doing GC, oh but don't worry better GC is in the next version, oh wait the next version, nm the next version), and the whole Rails community is built around absurd bloat: nobody seems to care/notice that their gems are poorly implemented for anything other than scraping something together.

  2. Perl Turns 25... by Frosty+Piss · · Score: 5, Insightful

    ...And is sexier than ever.

    --
    If you want news from today, you have to come back tomorrow.
  3. I used it. Once. by Tsingi · · Score: 5, Interesting

    I wrote an app in Perl once. It was the only language that I could get to reliably connect to MSSQL from Linux.

    It was fun to write, but I go back and look at the code now and it looks like Greek.

    On the upside it's been running for over 5 years and having no problems at all.

  4. Perl where are you tonight by Wansu · · Score: 3, Funny

    Perl where are you tonight
    how can I now run scripts on my own
    I searched the filesystem
    even looked in slash sbin
    They rm'd the sym link and pffft you wuz gone

    --
    Wansu, th' chinese sailor
  5. Web Server development by Runesabre · · Score: 3, Insightful

    I remember when Perl was the workhouse behind all custom web server development. One of the few times I had "fun" writing code. Such a cryptic looking language that made perfect sense the moments you are writing it and completely alien days later.

    --
    Runesabre
    Enspira Online
    1. Re:Web Server development by Frequency+Domain · · Score: 3, Funny

      It always struck me as one of the poster children of "write-only" languages, right up there with APL.

    2. Re:Web Server development by Anonymous Coward · · Score: 5, Insightful

      Perl is write-only in the hands of stupid hacks. Oh wait, that's any language.

    3. Re:Web Server development by Frequency+Domain · · Score: 5, Funny

      A friend was editing a perl program when his cat walked across the keyboard. It took him a while to figure out which parts were written by the cat. That's when I decided to avoid perl.

    4. Re:Web Server development by dotgain · · Score: 5, Insightful

      Your friend should look into revision control software and possibly getting the cat his own terminal. This way the cat's contributions can be easily tracked.

  6. Why perl? by Frequency+Domain · · Score: 4, Interesting

    What can perl do that newer languages such as python and ruby can't do, and do more readably/maintainably?

    I understand about path dependence and sunk costs, which is why we still have COBOL, I'm asking about language features that are unique to perl.

    1. Re:Why perl? by miletus · · Score: 5, Interesting

      How much of readability is the fault of the language vs the developer? Cut-n-paste coding is the bane of any language.

      As a perl programmer, I sometimes ask, what can python or ruby do that perl can't?

      MVC web framework like Rails or Django? Catalyst, Mojolicious, etc. PSGI has taken a lot of pain out of deployment of apps.

      Good, modern object system? Moose.

      GUI stuff? There's Wx and Qt interfaces.

      OK, embedding C looks much easier in python, but I've never needed that.

      If all the CPAN stuff would just work with other languages, I'd be more willing to switch. Javascript seems to be where all the web stuff is heading anyway.

    2. Re:Why perl? by preaction · · Score: 3, Interesting

      Surprisingly, embedding C++ in Perl is easier than embedding C. Of course, that's just my opinion, there aren't a lot of docs on the C++ topic, and I am one of the few Perl programmers who actually enjoy C++.

      The Parrot VM http://www.parrot.org/ is supposed to be for dynamic languages what the CLR and JVM are for Microsoft and Java respectively. If it ever makes it to prime time, then you could use your CPAN module with Ruby, or vice-versa.

    3. Re:Why perl? by dotgain · · Score: 3, Informative

      It's worth noting that Larry Wall won the IOCCC - twice. (I don't say this to support the GP's remark, more to attest to Larry Wall's awesomeness)

    4. Re:Why perl? by Thud457 · · Score: 3, Funny

      Larry Wall won the IOCCC - twice.

      That just makes him incomprehensible in two languages.

      --

      the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

    5. Re:Why perl? by narcc · · Score: 4, Informative

      No one cares about ruby. It's a dying little niche language. It had a good run, but that's all in the past now. To me, ruby never really felt complete. (It didn't even get a step method to its range class until 1.8.7) There was always some absurd limitation you had to work around or some needlessly obscure feature or rule to learn before you can do something obvious in just about every other language (What's up with things like this? 10.times { |i| puts i } madness!)

      Python, well, python enjoys some popularity, but I just don't think it's likely to hang-on like perl. Probably because of the whitespace issue and the big 2.x 3.x split. Perl filled a particular niche really well, and was a good fill-in in a few others (remember when it powered your website's counter and guestbook?). Python never really found a home as there isn't any particular area where it really stands out -- or is even arguably a good fit. You'll find a lot of "it can be used for ..." but not a lot of "It's really great for ..."

      As for readability, well, I can't say that it's a terribly readable language. I get that everyone is forced to indent their code (apparently, the whole world forgot about pretty printers) but that's not all there is to readability. Neither is readability all there is to maintainability. (You could even argue that the whitespace rules actually hurt readability, as it takes away otherwise helpful cues.)

      Let's not forget that you don't have to write illegible perl code. Really, it's not required!

      COBOL's staying power was due to much more than "sunk costs". It was, and still remains, the best tool for the job. You'll find tons of failed COBOL to Java conversion projects from the late 1990's as a testament to that. It's really hard to beat COBOL on performance and even harder to find a language that's as easy to read and maintain. (Not that there isn't lots of room for improvement. It was designed to be readable, however, and it shows.) In short: It's easy to learn, easy to read and maintain, and lightning fast.

      Anyhow, to answer your question: Manipulating strings is a strength that is not shared by many other languages to any significant degree, and this makes it a great fit for a broad range of applications to which python and ruby just aren't as well suited. (Working with strings in python 2.x is terrible -- even just outputting them can be troublesome due to the bizarre default behavior of 'print'. This has improved, but not much, in 3.x) I would argue that PHP is popular due in no small part to that as well (I've always thought of it as a simpler version of perl. A related note: PHP was originally written in perl.)

    6. Re:Why perl? by bill_mcgonigle · · Score: 3, Informative

      Couldn't it? Would it be possible, at least in theory, to compile CPAN modules to a binary format that could be linked to other programming languages? Is there any reason that CPAN couldn't be turned into something more like a shared library?

      Yes, this is part of the perl6 effort. There are ports of all the other scripting languages to the ParrotVM being written for perl6. Once that's worked out you can write a module in Ruby, run it from Python - it doesn't matter. Use the best tool for the job (which is often the one you're most comfortable with).

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  7. And here is the birthday cake by perl6geek · · Score: 4, Informative
  8. Perl 6? by kriston · · Score: 3, Insightful

    Okay, so let's have a roll call of those of us using Perl 6 in production.

    Hands?

    Anybody?

    --

    Kriston

  9. Re:hmmm by preaction · · Score: 3, Informative

    As a Perl master, I agree with your perspective: Perl is the UNIX philosophy taken past its logical conclusion. It is more logical than shell scripts, more terse than C, greater than both for the everyday tasks that befall a serious computer user (and absolutely essential for a UNIX administrator).

  10. Re:I used it. Once. by readin · · Score: 4, Insightful

    What I found in using Perl was that no two Perl programmers could read each others code. Much of the expressiveness and versatility that people talk about comes at the expense of a huge amount of syntax and the ability of the language to assume values (like $_ instead of requiring them to be explicit). What happens in practice is people learn a subset of syntax which is large enough to do what they need to do and it often isn't the same subset that someone else learned. And when reading someone else's code, it can be very difficult to look things up because it often isn't even clear what the syntax is (in part because so much gets assumed).

    When the boss hands me a flat text file with 50,000 lines in some random format that needs to be parsed and loaded into the database, I dust off my Perl book and write a short application to read each line and spit out SQL. I don't need the safety of Java or the byte processing of C. I don't need to handle every possible exception that could be thrown when opening a file. I don't need a GUI. I just need to open a file, read a line of text, use some regular expressions, do some tokenizing, and spit out more text into a separate file. Perl is fantastic for that. But I don't find much other use for Perl.

    --
    I often don't like the choices people make, but I like the fact that people make choices. That's why I'm a conservative.
  11. Re:I used it. Once. by CaptSlaq · · Score: 4, Insightful

    And, in python: list = [1, 1, 2, 2, 3, 3, 4, 4, ] unique = set(list)

    Which is more readable?

    use List::MoreUtils qw(uniq);

    my @words = qw(foo bar baz foo zorg baz);
    my @unique_words = uniq @words;

    What was that about readability?

  12. Re:I used it. Once. by bill_mcgonigle · · Score: 3, Insightful

    What I found in using Perl was that no two Perl programmers could read each others code.

    That's silly. I'm just a medium-grade Perl jockey and I read and understand other projects' code. I find bugs and submit patches.

    Perl doesn't force good style on you, but if you follow the guides of Perl Best Practices and check yourslelf with Perl Critic you're going to produce code that most programmers can follow.

    Some people aren't comfortable with 'enough rope to hang yourself', which is fine. Others think that forced indentation is the answer to good code style (I think semantic analysis is better). There are lots of options.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  13. Perl versis c++ by Okian+Warrior · · Score: 3

    Languages which are simple to learn (c++, for example)

    WHAT?

    Ahem. "Languages which are simple to learn (c++, for example)".

    Perl has lots more reserved words than c++.
            (Examples: "say", "not", "and", "open")

    Perl has lots more operators than c++
            (Example: "//" is an operator in perl. So is "<=>", "+/*", "..", and "eq").
            (See if you can understand the flip flop operator on first reading.)

    Perl has several contexts, and the meaning of an operator or function is context dependent.
            (Example contexts: "scalar", "list", "null", "string")
            (Example differences: Saying "$i = sort @array" has a completely different meaning from "@i = sort @array")

    Perl distinguishes a variable from its value.
            (Example: $i = 12; followed by $i = "twelve". The same variable, points to one of two values in memory. C++ binds the variable to the memory location, perl does not. Programmers have trouble wrapping their mind around this.)

    Perl references are not pointers (but have some similarities). C++ programmers have a hard time with this also.

    Perl has all the overloading and class syntax found in c++.

    Perl doesn't have a precompiler.

  14. Re:libraries first by FacePlant · · Score: 3, Insightful

    Are you using 5.16.2?
    Are you using Moose/Mouse/Moo for complex data types and/or object oriented programming.?

    Perl is alive and well.

    If you think of 5 as being a syntax identifier, then you might be pleased to see all of the development that's gone on since Perl 4 gave way to Perl 5.

    It sounds a little bit like you're complaining that Perl's development has not followed your idea of semantic version numbering.

    --
    My Heart Is A Flower