Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: 5.18.0 is available NOW!

by Arunbear (Parson)
on May 19, 2013 at 12:28 UTC ( #1034209=note: print w/ replies, xml ) Need Help??


in reply to 5.18.0 is available NOW!

Do you mind telling us what is actually new in this release? Thanks.


Comment on Re: 5.18.0 is available NOW!
Re^2: 5.18.0 is available NOW!
by Grimy (Pilgrim) on May 19, 2013 at 12:49 UTC

    See perldelta.

    Most notable changes (imo):

    • The seed used by Perl's hash function is now random.
    • Lexical subroutines
    • given now aliases the global $_
    • Lexical $_ is now experimental

      What does 'lexical $_ is now experimental' mean? Is something like this still doable?

      while(<SOMEHANDLE>) { chomp; my $string = "hello" .$_; print $string; }

      Still work?

        Yes, still works. That's not explicitly creating a lexical $_.

        Here's an excerpt from Perl 5.18.0's "perlvar" (I'm not linking here because perldoc.perl.org hasn't loaded up v5.18 yet.):

        $_ is by default a global variable. However, as of perl v5.10.0, you can use a lexical version of $_ by declaring it in a file or in a block with "my". Moreover, declaring "our $_" restores the global $_ in the current scope. Though this seemed like a good idea at the time it was introduced, lexical $_ actually causes more problems than it solves. If you call a function that expects to be passed information via $_, it may or may not work, depending on how the function is written, there not being any easy way to solve this. Just avoid lexical $_, unless you are feeling particularly masochistic. For this reason lexical $_ is still experimental and will produce a warning unless warnings have been disabled. As with other experimental features, the behavior of lexical $_ is subject to change without notice, including change into a fatal error.


        Dave

Re^2: 5.18.0 is available NOW!
by Hugmeir (Sexton) on May 19, 2013 at 12:58 UTC

    Off the top of my head, the big ones are:

    * Lexical subroutines! package Foo { my sub bar { ... } } Now you can use bar() inside Foo, but there is no way to access that from the outside. There's also state subs, in case you ever seen those.

    * Regexp code blocks that actually work! /(?{...})/ and /(??{...})/ now work exactly as you'd expect them to. Before it was a buggy pain.

    * Character class set operations! This is my personal favorite. Basically, now you can write /(?[ \p{Math} & \p{Symbol} ])+/ where before you had to do /((?=\p{Math})\p{Symbol})+/. There's other operations too, like + or -.

Re^2: 5.18.0 is available NOW!
by BrowserUk (Pope) on May 19, 2013 at 13:03 UTC

    It breaks everything for no good reason. Dumbest of the recent batch of dumb upgrades. I vote reverting to 5.10 and starting again.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

        That is not the problem; the response to that is.

        When considering a breaking change, I was taught to ask three questions:

        1. Is the breakage actually necessary?

          Is the thing being 'fixed' actually manifesting itself in production code.

          Has any real-world occurrence of the ACA actually been witnessed or reported?

        2. If so, can the breakage be limited in scope?

          Either by limiting the total breakage; or by selectively applying the breaking fix only when required.

          Could the 'fix' have been limited to (say) only when taint was enabled?

        3. Is the breaking 'fix' the *ONLY* solution to the problem?

          Not the first. Not the best. Not the least effort or least worst; but the ONLY?

          Is it necessary to randomise all hashes differently?

          Wouldn't picking the same random hash initialisation, for all hashes for any given run, have been just as effective at stopping real-world exploits in the wild?

      > It breaks everything for no good reason.

      "everything"?

      Could you please elaborate what you are referring to?

      Cheers Rolf

      ( addicted to the Perl Programming Language)

        Hash randomization broke a lot of CPAN modules that were relying on hash order (usually relying on it in the test suite). These were mostly caught during 5.17.x series, so if you've got recent versions of those modules, you'll be OK.

        Amongst the affected distributions were DBI, libwww-perl, Catalyst-Runtime, DBIx-Class, Gtk2, Data-Visitor, PDF-API2, RDF-Trine, Template-Toolkit and Dancer (via MIME-Types). Many of these are major distributions that a lot of other distributions depend on.

        package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1034209]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2014-09-20 19:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls