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.)
|
|---|
| 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 | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 20:05 UTC |