Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?

by BrowserUk (Patriarch)
on Aug 20, 2013 at 00:49 UTC ( [id://1050106]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
in thread Is auto-dereferencing worth forcing upgrades to newer versions of Perl?

Not in core, it doesn't. (Though I wish it did.)

Wish granted.

Really, it does:

#! perl -slw use strict; package Thing; sub new { bless [], $_[0] }; sub push { push @{ shift() }, @_ } package main; use Data::Dump qw[ pp ]; my %x = ( foo => [ map Thing->new, 1 .. 10 ] ); $x{foo}[0]->push( 1,2,3 ); pp \%x; __END__ C:\test>junk66 { foo => [ bless([1, 2, 3], "Thing"), bless([], "Thing"), bless([], "Thing"), bless([], "Thing"), bless([], "Thing"), bless([], "Thing"), bless([], "Thing"), bless([], "Thing"), bless([], "Thing"), bless([], "Thing"), ], }

That's 5.10, but it's worked right back to 5.6.1 (and probably before, but that's before my time with Perl.)

(And if aesthetics is the current, important criteria for the future of Perl5, there are plenty of other areas that definitely rate attention long before this.)


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.
  • Comment on Re^4: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
  • Download Code

Replies are listed 'Best First'.
Re^5: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
by xdg (Monsignor) on Aug 20, 2013 at 19:54 UTC

    It doesn't work on unblessed references, which is what the auto-deref feature does work on. (I thought you were referring to autobox.)

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
      (I thought you were referring to autobox.)

      No. I wouldn't touch autobox with yours let alone my own :)


      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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-24 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found