FAQ

On Fri Jul 18 12:44:06 2003, robert wrote:

ISO8--%%- [ON] Wanderlust: %p5p {T}(0/0/148)
(Summary)----L142--C0--Bot----
From: Tony Bowden <tony@kasei.com>
To: perl5-porters@perl.org
Cc: mjd@plover.com
Subject: Bug #6278: Explict call to DESTROY considered harmful
Date: Fri, 18 Jul 2003 19:15:19 +0100


http://bugs6.perl.org/rt2/Ticket/Display.html?id=6278

MJD considered changing perltoot to turn "Explicitly calling DESTROY is
also possible, but is usually never needed." into something more strongly
warning against ever doing it.

His original report never made it to p5p, but Damian's response did,
thus triggering a longish thread on what was wrong with perlbug.

However this left the bug report itself hanging.

As Damian pointed out, you may need to call DESTROY directly when
inheriting.

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
akin to:

Explicitly calling DESTROY should be avoided, other than when calling
SUPER::DESTROY.


Thoughts/comments?
Sometimes it’s necessary to call destructors pre-emptively in an END
block, if they rely on the presence of other objects. But in such cases,
one must ensure that the destructors are idempotent (e.g., return if
$self->{destroyed}++).

Search Discussions

  • Brian Fraser via RT at May 5, 2012 at 12:40 pm

    On Sun May 01 15:50:43 2011, sprout wrote:
    On Fri Jul 18 12:44:06 2003, robert wrote:

    ISO8--%%- [ON] Wanderlust: %p5p {T}(0/0/148)
    (Summary)----L142--C0--Bot----
    From: Tony Bowden <tony@kasei.com>
    To: perl5-porters@perl.org
    Cc: mjd@plover.com
    Subject: Bug #6278: Explict call to DESTROY considered harmful
    Date: Fri, 18 Jul 2003 19:15:19 +0100


    http://bugs6.perl.org/rt2/Ticket/Display.html?id=6278

    MJD considered changing perltoot to turn "Explicitly calling DESTROY is
    also possible, but is usually never needed." into something more
    strongly
    warning against ever doing it.

    His original report never made it to p5p, but Damian's response did,
    thus triggering a longish thread on what was wrong with perlbug.

    However this left the bug report itself hanging.

    As Damian pointed out, you may need to call DESTROY directly when
    inheriting.

    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
    akin to:

    Explicitly calling DESTROY should be avoided, other than when calling
    SUPER::DESTROY.


    Thoughts/comments?
    Sometimes it’s necessary to call destructors pre-emptively in an END
    block, if they rely on the presence of other objects. But in such cases,
    one must ensure that the destructors are idempotent (e.g., return if
    $self->{destroyed}++).
    Well, perltoot doesn't exist anymore, and there's nothing about calling
    DESTROY directly in perlobj and perlootut anymore, so maybe this ticket
    can be marked as resolved. Though it would be nice if a executive
    summary of this thread made it into perlobj.


    ---
    via perlbug: queue: perl5 status: open
    https://rt.perl.org:443/rt3/Ticket/Display.html?id=6278
  • Tom Christiansen at May 7, 2012 at 8:44 pm
    Well, perltoot doesn't exist anymore
    Wanna bet? :)

    --tom
  • James E Keenan via RT at Sep 19, 2013 at 12:04 am

    On Sat May 05 05:40:11 2012, Hugmeir wrote:
    On Sun May 01 15:50:43 2011, sprout wrote:
    On Fri Jul 18 12:44:06 2003, robert wrote:

    ISO8--%%- [ON] Wanderlust: %p5p {T}(0/0/148)
    (Summary)----L142--C0--Bot----
    From: Tony Bowden <tony@kasei.com>
    To: perl5-porters@perl.org
    Cc: mjd@plover.com
    Subject: Bug #6278: Explict call to DESTROY considered harmful
    Date: Fri, 18 Jul 2003 19:15:19 +0100


    http://bugs6.perl.org/rt2/Ticket/Display.html?id=6278

    MJD considered changing perltoot to turn "Explicitly calling
    DESTROY is
    also possible, but is usually never needed." into something more
    strongly
    warning against ever doing it.

    His original report never made it to p5p, but Damian's response did,
    thus triggering a longish thread on what was wrong with perlbug.

    However this left the bug report itself hanging.

    As Damian pointed out, you may need to call DESTROY directly when
    inheriting.

    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
    akin to:

    Explicitly calling DESTROY should be avoided, other than when calling
    SUPER::DESTROY.


    Thoughts/comments?
    Sometimes it’s necessary to call destructors pre-emptively in an END
    block, if they rely on the presence of other objects. But in such cases,
    one must ensure that the destructors are idempotent (e.g., return if
    $self->{destroyed}++).
    Well, perltoot doesn't exist anymore, and there's nothing about calling
    DESTROY directly in perlobj and perlootut anymore, so maybe this ticket
    can be marked as resolved. Though it would be nice if a executive
    summary of this thread made it into perlobj.

    Hugmeir,

    It appears to me that in pod/perlobj.pod, the section starting at
    "=head2 Destructors" *does* talk about calling DESTROY directly.

    Could you (or anyone review that section of perlobj.pod) and prepare a
    patch if needed?

    Otherwise, I recommend that this RT be closed in 30 days.

    Thank you very much.
    Jim Keenan

    ---
    via perlbug: queue: perl5 status: open
    https://rt.perl.org:443/rt3/Ticket/Display.html?id=6278
  • James E Keenan via RT at Oct 20, 2013 at 12:28 am

    On Wed Sep 18 17:03:55 2013, jkeenan wrote:
    On Sat May 05 05:40:11 2012, Hugmeir wrote:
    On Sun May 01 15:50:43 2011, sprout wrote:
    On Fri Jul 18 12:44:06 2003, robert wrote:

    ISO8--%%- [ON] Wanderlust: %p5p {T}(0/0/148)
    (Summary)----L142--C0--Bot----
    From: Tony Bowden <tony@kasei.com>
    To: perl5-porters@perl.org
    Cc: mjd@plover.com
    Subject: Bug #6278: Explict call to DESTROY considered harmful
    Date: Fri, 18 Jul 2003 19:15:19 +0100


    http://bugs6.perl.org/rt2/Ticket/Display.html?id=6278

    MJD considered changing perltoot to turn "Explicitly calling
    DESTROY is
    also possible, but is usually never needed." into something more
    strongly
    warning against ever doing it.

    His original report never made it to p5p, but Damian's response
    did,
    thus triggering a longish thread on what was wrong with perlbug.

    However this left the bug report itself hanging.

    As Damian pointed out, you may need to call DESTROY directly when
    inheriting.

    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
    akin to:

    Explicitly calling DESTROY should be avoided, other than when
    calling
    SUPER::DESTROY.


    Thoughts/comments?
    Sometimes it’s necessary to call destructors pre-emptively in an END
    block, if they rely on the presence of other objects. But in such
    cases,
    one must ensure that the destructors are idempotent (e.g., return if
    $self->{destroyed}++).
    Well, perltoot doesn't exist anymore, and there's nothing about calling
    DESTROY directly in perlobj and perlootut anymore, so maybe this ticket
    can be marked as resolved. Though it would be nice if a executive
    summary of this thread made it into perlobj.

    Hugmeir,

    It appears to me that in pod/perlobj.pod, the section starting at
    "=head2 Destructors" *does* talk about calling DESTROY directly.

    Could you (or anyone review that section of perlobj.pod) and prepare a
    patch if needed?

    Otherwise, I recommend that this RT be closed in 30 days.
    More than 30 days have elapsed; no patch submitted. Closing ticket.

    Thank you very much.
    Jim Keenan

    ---
    via perlbug: queue: perl5 status: open
    https://rt.perl.org:443/rt3/Ticket/Display.html?id=6278

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 1, '11 at 10:50p
activeOct 20, '13 at 12:28a
posts5
users2
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase