develooper Front page | perl.perl5.porters | Postings from April 2015

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

Thread Next
From:
Gabor Szabo
Date:
April 25, 2015 06:16
Subject:
[perl #124387] AUTOLOAD is not called when DESTROY is missing in 5.20.1 - but this is not documented
Message ID:
rt-4.0.18-13788-1429942583-862.124387-75-0@perl.org
# 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


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About