New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicit call of ->DESTROY method considered harmful #3647
Comments
From @mjdominusExplicitly calling DESTROY is also possible, but is usually never needed. This seems misleading to me. When I teach Perl OOP classes, I always 1. In order to call DESTROY, you must have a reference to the object; 2. Later, when the object's reference count goes to zero, Perl will my $census; sub new { sub DESTROY { I am considering a doc patch that will say "Never call DESTROY manually." Thanks. |
2 similar comments
From @mjdominusExplicitly calling DESTROY is also possible, but is usually never needed. This seems misleading to me. When I teach Perl OOP classes, I always 1. In order to call DESTROY, you must have a reference to the object; 2. Later, when the object's reference count goes to zero, Perl will my $census; sub new { sub DESTROY { I am considering a doc patch that will say "Never call DESTROY manually." Thanks. |
From @mjdominusExplicitly calling DESTROY is also possible, but is usually never needed. This seems misleading to me. When I teach Perl OOP classes, I always 1. In order to call DESTROY, you must have a reference to the object; 2. Later, when the object's reference count goes to zero, Perl will my $census; sub new { sub DESTROY { I am considering a doc patch that will say "Never call DESTROY manually." Thanks. |
From @rspierISO8--%%- [ON] Wanderlust: %p5p {T}(0/0/148) http://bugs6.perl.org/rt2/Ticket/Display.html?id=6278 MJD considered changing perltoot to turn "Explicitly calling DESTROY is His original report never made it to p5p, but Damian's response did, However this left the bug report itself hanging. As Damian pointed out, you may need to call DESTROY directly when This leaves 2 main options: 1) Leave everything as is, and close the bug. 2) Add something to the docs that changes the above line into something Explicitly calling DESTROY should be avoided, other than when calling Thoughts/comments? Tony |
From @cpansproutOn Fri Jul 18 12:44:06 2003, robert wrote:
Sometimes it’s necessary to call destructors pre-emptively in an END |
From @HugmeirOn Sun May 01 15:50:43 2011, sprout wrote:
Well, perltoot doesn't exist anymore, and there's nothing about calling |
From tchrist@perl.com
Wanna bet? :) --tom |
From @jkeenanOn Sat May 05 05:40:11 2012, Hugmeir wrote:
Hugmeir, It appears to me that in pod/perlobj.pod, the section starting at Could you (or anyone review that section of perlobj.pod) and prepare a Otherwise, I recommend that this RT be closed in 30 days. Thank you very much. |
From @jkeenanOn Wed Sep 18 17:03:55 2013, jkeenan wrote:
More than 30 days have elapsed; no patch submitted. Closing ticket. Thank you very much. |
@jkeenan - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#6278 (status was 'rejected')
Searchable as RT6278$
The text was updated successfully, but these errors were encountered: