Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Perl Programming

Perl 5.22 Released 92

kthreadd writes: Version 5.22 of the Perl programming language has just been released. A major new feature in this release is the double diamond operator; like the regular diamond operator it allows you to quickly read through files specified on the command line but does this in a much safer way by not evaluating special characters in the file names. Other new features include hexadecimal floating point numbers, improved variable aliasing and a nicer syntax for repetition in list assignment. Also, historical Perl modules CGI.pm and Module::Build are removed from the core distribution.
This discussion has been archived. No new comments can be posted.

Perl 5.22 Released

Comments Filter:
  • Finally!@#$% :)
    • by plopez ( 54068 ) on Tuesday June 02, 2015 @05:31PM (#49825871) Journal

      Oblig:

      BEFOREHAND: close door, each window & exit; wait until time;
              open spell book; study; read (spell, $scan, select); tell us;
      write it, print the hex while each watches,
              reverse length, write again;
                            kill spiders, pop them, chop, split, kill them.
                                  unlink arms, shift, wait and listen (listening, wait).
      sort the flock (then, warn "the goats", kill "the sheep");
              kill them, dump qualms, shift moralities,
                            values aside, each one;
                                    die sheep; die (to, reverse the => system
                                                  you accept (reject, respect));
      next step,
              kill next sacrifice, each sacrifice,
                            wait, redo ritual until "all the spirits are pleased";
              do it ("as they say").
      do it(*everyone***must***participate***in***forbidden**s*e*x*).
      return last victim; package body;
              exit crypt (time, times & "half a time") & close it.
                            select (quickly) and warn next victim;
      AFTERWARDS: tell nobody.
              wait, wait until time;
                            wait until next year, next decade;
                                    sleep, sleep, die yourself,
                                                  die @last

      • by plopez ( 54068 )

        I forgot the header
        # Black Perl, adapted for Perl 5 by Jonadab.
        # Adapted from Black Perl, as seen in the Camel,
        # 2nd ed., p 553

        • by Ed Avis ( 5917 )
          Sadly this snippet does not work in recent perl versions (I tried 5.18). 'each window' for example now needs to be 'each %window' since hashes must always have the % prefix. (In ancient perl versions the % was added implicitly if not given)
  • by Anonymous Coward

    Because I wrote it in Perl 6

    • So was it Perl 6 or you that failed?

  • I though Perl got replaced by Python years ago.
    • Re: (Score:3, Insightful)

      by Anonymous Coward
      I work as a system administrator and although Python is quite popular nowadays I would say Perl is still one of the go-to choices for a lot of sysadmins. Sure Python is doing just fine, a lot of people use it; but I wouldn't say that it has replaced Perl in any way.
    • Re: (Score:2, Redundant)

      by plopez ( 54068 )

      Nah.... Python replaced Fortran 77. At least in the significant white space arena.

      Significant white space? Seriously?

      • Nah.... Python replaced Fortran 77. At least in the significant white space arena.

        Significant white space? Seriously?

        Yea, what's old is new again!

        It was a bad idea the first time folks, although there was justification back then due to restrictions in program size and character sets...

        Stick around, I'm sure we will recycle a LOT of old ideas.... Trick is to line up the new name with the old...

        Cloud Computing == Mainframe

        Etc.. You try a few...

        • by plopez ( 54068 )

          In those days they used punch cards so there *was* justification, it was a limitation of technology available at the time. To reintroduce it, 4 years after it was abandoned by Fortran 90, is a serious lapse of good sense. There is no good reason to have it other than as a joke or out of sadism.

        • by plopez ( 54068 )

          "Etc.. You try a few..."

          Graph databases = network databases and they sucked then as now
          NoSQL databases = recipe card and network DBs and they sucked then and suck now
          Java VM = UCSD Pascal
          VMs = IBM VM OS
          DevOps = 80's and 90's start ups where you had to do everything.... and it sucked
          Browser = Thin client
          IM = IRC
          XQuery = Heirarchical databases which sucked then and suck now
          OO languiages such as Java are converging on LISP and the LISP family of programming languages vindicating a language approach invented i

          • OO languiages such as Java are converging on LISP and the LISP family of programming languages vindicating a language approach invented in the 50's and which does not suck.

            In what sense? If you mean first-class functions and the associated techniques and patterns, then this is not at all unique to Lisp. The real distinguishing feature of Lisp is code-as-data and manipulations on it, and mainstream OO languages are definitely not anywhere even close.

    • by prof_robinson ( 2632705 ) on Tuesday June 02, 2015 @05:35PM (#49825903)
      Perl isn't going anywhere. In fact, installs and contributions to CPAN are up almost 1200% in the last 10 years. What's happened to Perl, is it's become ubiquitous...it's literally everywhere. It's not our fault you haven't noticed.
      • The last time I heard about Perl was in college ten years ago. I was taking Perl because it wasn't Java. The college couldn't afford to renew Microsoft site license for a few years, hence every programming course had every flavor of java: strong, black and hot. Long story short, the Perl class got cancelled.
    • by rduke15 ( 721841 ) <rduke15@gTWAINmail.com minus author> on Tuesday June 02, 2015 @05:35PM (#49825905)

      Replaced where? Apparently not on my Debian servers:

      # find /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file | grep "Perl script" | wc -l
      119
      # find /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file | grep "Python script" | wc -l
      29

      • On my FreeNAS file server:

        # find /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file | grep "Perl script" | wc -l
        2
        # find /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file | grep "Python script" | wc -l
        2

        Maybe not a fair comparison. :)

    • by Anonymous Coward

      I though Perl got replaced by Python years ago.

      In the same way that the crappy CGI programs written by crappy (non-)programmers space has been replaced by PHP, yes, Perl has been replaced by Python in many other write-crappy programs by (non-)programmer spaces. But hey, you can brag that objects are part of the language! (even though it's the same object system as Perl).

    • by fisted ( 2295862 )

      I wrote my sig in perl

  • What's the use case for hexadecimal floating point numbers? Seems like a "Why not" feature.
    • That was my thought exactly. I nearly spit out my coffee when I read that wondering if it was some sort of joke.

    • And the funniest part of this all, is that exponential notation had to be changed to use p rather than e since e is a hexadecimal number.

    • by suutar ( 1860506 )

      It probably is mostly a "why not". I expect there will be a very few folks who will get some use out of being able to really specify an exact floating point value, though, instead of specifying a decimal float and having it turned into "the IEEE double which is closer than any other to that value".

      • by vux984 ( 928602 )

        I expect there will be a very few folks who will get some use out of being able to really specify an exact floating point value, though,

        The folks who needed that have been casting byte arrays to double when they really wanted to set it to a specific bit pattern.

    • by gnasher719 ( 869701 ) on Tuesday June 02, 2015 @05:53PM (#49826065)

      What's the use case for hexadecimal floating point numbers? Seems like a "Why not" feature.

      Useful when you implement high quality transcendental functions and need floating-point constants that are guaranteed to be converted exactly as intended.

    • What's the use case for hexadecimal floating point numbers? Seems like a "Why not" feature.

      Oh no.. It's for the obfuscated Perl contest.... You can do amazing things with that..

    • Guaranteed Precision and Accuracy.

    • by serviscope_minor ( 664417 ) on Wednesday June 03, 2015 @03:08AM (#49828323) Journal

      The use of hex floats is to be able to write out floats efficiently and with guaranteed full accuracy to a text file. You can use decimal but you need a LOT of digits in order to do so, making the files rather bloaty. The reason Perl now supports them I suspect is because they're now supported in a bunch of other languages such as C++, so if you want to be able to mutually exchange data, you need hex floats in perl too.

      Pesonally, I like them. A lot of data one generates in numerics isn't exactly human readable, but is generated as text for easy parsing with the original language and other tools. For example if your algorithm generates a log of checkpoints you can restart interrupted computations (great for splitting work into smaller chunks for a cluster), for example. To do that properly, you need to be able to save the state without loss.

      That's just one of many examples.

      It's curious that people (not you) have been guffawing over how stupid Perl is for doing this. It's funny that a supposedly hackish community has a significant cadre who brags about their anti-intellectualism as much as any self-respecting highschooler.

    • The perldelta [cpan.org] mentions that there were a number of fixes/enhancements to floating point numbers handling implemented.

      I'm not sure why the hex fp (a rather obscure feature) was singled out for the summary.

  • I'm surprised no one's posted this [xkcd.com] yet.
    • I'm surprised no one's posted this [xkcd.com] yet.

      Actually, I've always been surprised at how reluctant many developers have been to accept regular expressions as a part of their trade. They are very useful shortcuts for string manipulation, and to Perl's credit they defined regex conventions for other languages, like Java and R, to name a couple.

      • There is an issue of readability that crops up when maintainance is a consideration. Serious regex reads like APL after being put through a shredder.

        I'd rather not use a regex if there's something clearer available:

        myString.find('searchTerm')

        ...and...

        myString.replace('searchTerm','replacementTerm')

        ...and so on.

        On the other hand, when writing my own language (yeah, I know, shut up), one of the very first things I did was incorporate regex handling, so WTF. :)

        • But your examples aren't really particularly different when using regex, at least with a sane library. I mean, in Python, for example, they'd be re.search and re.sub, respectively, but everything else is the same.

      • to Perl's credit they defined regex conventions for other languages

        Yes, but the Perl designer also learned from his mistakes (regexp become hard to maintain) to build a new regexp language ("grammars"), both more powerful, more generic and more readable and it's coming in Perl 6.
        http://doc.perl6.org/language/... [perl6.org]

    • Or even better, this [xkcd.com]

BLISS is ignorance.

Working...