Slashdot Mirror


Perl 5.10, 20 Year Anniversary

alfcateat writes "Perl 1 was released to the public by Larry Wall 20 years ago yesterday. To celebrate, Perl5Porters have released Perl5.10, the latest stable version of Perl 5. Happy Birthday Perl! Perl 5.10 isn't just a bug fix version: it's full of new features that I'm eager to use: named captures in regular expressions, state variables for subroutines, the defined-or operator, a switch statement (called given-when, though), a faster regex engine, and more. You can read more about the changes in perldelta."

6 of 304 comments (clear)

  1. Hmmmmmm by Billosaur · · Score: 4, Insightful

    I was right... we hit double-digits with Perl 5 before Perl 6 became available... and don't go on about Parrot -- it's not Perl 6. I'll be interested to download 5.10 and see what it can do. The speedier regex engine is going to be a great boon.

    --
    GetOuttaMySpace - The Anti-Social Network
    1. Re:Hmmmmmm by fbjon · · Score: 4, Insightful

      The speedier regex engine is going to be a great boon. Not to mention the named captures. Finally, no more empty capture vars because some parentheses were removed in the middle of the expression!
      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
  2. Switch statements are syntactic sugar by morgan_greywolf · · Score: 3, Insightful

    Switch statements are syntactic sugar. They're really not needed. Nested if/then/else do the same thing. There are also other constructs that you can use to get around the whole nested if/then/else thing too in many cases.

    1. Re:Switch statements are syntactic sugar by Phroggy · · Score: 4, Insightful

      Hey now - those of us who write Perl code know exactly what our own code does, or at least we did when we wrote it. It's reading somebody else's code (or our own, years later) that's the tricky part. Perl is a lot of fun to write!

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  3. Much Thanks to Mr. Wall by BodhiCat · · Score: 5, Insightful

    Much thanks to Mr. Wall for creating a fast and dirty lannguage. The Oscar Madison of programming languages, much easier to learn and use than Java, the script equivilent of Felix Unger. Perl has been great for small cgi web things, not a lot of fuss and bother. Wouldn't use it for anything over a few hundred lines, tho, too easy for variable to get confused, even when using strict. Now if I can just get the DBI to MySQL on OS 10.5 to work my life would be perfect.

  4. Implicit vs. explicit parsing by SamP2 · · Score: 3, Insightful

    2 + "3" == 5 (not a TypeError as in Python)
    "2" + 3 == 5 (not "23" as in JavaScript)
    And this is intuitive, useful, or best practice, how exactly?

    Implicit parsing a num to a string is straightforward and will pretty much always work, even if you may get wierd results like "1.66666666666666666667". But the other way is just too careless to let be implicitly done. You may unexpected errors when for some reason the string you use cannot be parsed, and you may get either an unexpected datatype or a truncated result when a parsed string would not match the other num you add to it (such as int a = x+5 where x is a string "3.5").

    Casting from string to number should always be done explicitly, with precise definition of the data type you cast to, and ideally with an error catching block in case something goes wrong. Letting it be done implicitly is a recipe for headache.