Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by tobyink (Abbot)
on Aug 15, 2013 at 13:49 UTC ( #1049591=note: print w/ replies, xml ) Need Help??


in reply to Is auto-dereferencing worth forcing upgrades to newer versions of Perl?

There are plenty of good features that are worth upgrading for in 5.14, but this is not one of them.

Even when writing code that requires Perl 5.14, I avoid this new feature, preferring to use an explicit @{} dereference operation.

As chromatic has pointed out before, when combined with the fact that Perl 5.12 allows each, keys and values to work on arrays like they do on hashes, this feature introduces ambiguities. (What happens in blessed arrayrefs which overload hashrefification? Or blessed hashrefs which overload arrayfication? Or blessed scalar refs which overload both?!)

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


Comment on Re: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
Select or Download Code
Re^2: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
by tinita (Parson) on Aug 20, 2013 at 11:38 UTC
    (What happens in blessed arrayrefs which overload hashrefification? Or blessed hashrefs which overload arrayfication? Or blessed scalar refs which overload both?!)
    push $blessed_hashref_or_arrayref, ...
    results in:
    "Not an ARRAY reference" or
    "Not an unblessed ARRAY reference"

    each $blessed_hashref_or_arrayref
    results in:
    "Type of argument to each on reference must be unblessed hashref or arrayref"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-08-01 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls