Perl-Critic / PPI

53 stars 44 forks source link

PPI::Document destructor getting engaged in a way that potentially breaks children? #187

Closed edenhochbaum closed 7 years ago

edenhochbaum commented 8 years ago

It seems like the PPI::Document destructor is getting engaged sometimes in a way that breaks child elements when references to those children remain? The below works as (I) expected with redefine of the destructor, but breaks when I comment that line out..

use strict;
use warnings; no warnings 'once';

use PPI::Document; # VERSION 1.220

*PPI::Document::DESTROY = sub { };

my ($ppistatementpackage) = PPI::Document->new(\"package Blah;")->children;

print "$ppistatementpackage";
moregan commented 7 years ago

This is a duplicate of #112