| Store | Cart

[perl #124387] AUTOLOAD is not called when DESTROY is missing in 5.20.1 - but this is not documented

From: Gabor Szabo (via RT) <perl...@perl.org>
Fri, 24 Apr 2015 23:16:23 -0700
# New Ticket Created by  Gabor Szabo 
# Please include the string:  [perl #124387]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=124387 >


In earlier versions of perl if AUTOLOAD is defined in a module but DESTROY
is not defined, the AUTOLOAD would be executed when the object goes out of
scope and one would have had to add an empty DESTROY to eliminate the
problem caused by this.

In 5.20.1 this does not seem to be the case. In 5.20.1 it seems if AUTOLOAD
won't be called when the object goes out of scope.

However I think the documentation in perlobj still indicates the old
behavior
http://perldoc.perl.org/perlobj.html#Destructors
and I could not find any indication in the perldelta docs that would imply
this change.

So I wonder if this was an unplanned change in perl,
a lack of documentation, or something else.

The issue was discussed here as well:

http://www.perlmonks.org/?node_id=1124504

Recent Messages in this Thread
Gabor Szabo (via RT) Apr 25, 2015 06:16 am
Dave Mitchell Apr 25, 2015 10:25 am
Ricardo Signes May 26, 2015 12:01 pm
Eric Brine May 26, 2015 09:04 pm
Messages in this thread