Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: use experimental 'autoderef'; ???

by stevieb (Canon)
on Jun 29, 2017 at 00:08 UTC ( [id://1193794]=note: print w/replies, xml ) Need Help??


in reply to use experimental 'autoderef'; ???

Looks like a doc bug:

perl -v This is perl 5, version 24, subversion 1 (v5.24.1)

On the CLI:

perldoc experimental

After searching for "autoderef":

The supported features, documented further below, are: array_base - allow the use of $[ to change the starting index of @ +array autoderef - allow push, each, keys, and other built-ins on refere +nces ...

Online, however, searching for "perldoc experiment" (resulting doc: experiment):

Array and hash container functions accept references Using this feature triggered warnings in the category experimental::au +toderef . Superseded by Postfix dereference syntax. Introduced in Perl 5.14.0 Removed in Perl 5.24.0

There was definitely a good long period where autoderef was in play, but there was the postderef camp as well. The fight was won by the postderef camp. It was a drawn out ordeal ;)

update: I may be missing what you're getting at here, but either way, something doesn't line up.

updte2: Since it was so long ago, I don't recall the arguments on each side I had, but iirc, postderef was better for longevity, but I'm still old-school. I write all of my code so it runs on 5.8.9... no magic for me.

Replies are listed 'Best First'.
Re^2: use experimental 'autoderef'; ???
by Eily (Monsignor) on Jun 29, 2017 at 09:46 UTC
    I don't recall the arguments on each side

    There are probably many more arguments for both sides, but I remember reading somewhere that one of the reasons postderef won is that some of the function concerned by the autoderef feature work on either hashes or arrays. So with each $hash{THING};, if %hash is empty, the target of each could either be autovivified into a hash or an array, or this could throw an error. But there's also keys $obj; where $obj can overload the dereferencing operators @{} and %{} and perl would have to choose which one to call (or again, throw an error). each $hash{RUD}->@* or each $obj->%* leaves no such ambiguity.

Re^2: use experimental 'autoderef'; ???
by tobyink (Canon) on Jun 29, 2017 at 05:44 UTC

    There was definitely a good long period where autoderef was in play, but there was the postderef camp as well. The fight was won by the postderef camp. It was a drawn out ordeal ;)

    Both camps should die in fire.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found