develooper Front page | perl.perl5.porters | Postings from October 2010

Re: [RFC] Exposing PL_dirty to perl space

Thread Previous | Thread Next
From:
Tim Bunce
Date:
October 3, 2010 08:19
Subject:
Re: [RFC] Exposing PL_dirty to perl space
Message ID:
20101003151848.GG27905@timac.local
On Sat, Oct 02, 2010 at 09:17:17PM +0000, Ævar Arnfjörð Bjarmason wrote:
> On Sat, Oct 2, 2010 at 17:58, Florian Ragwitz <rafl@debian.org> wrote:
> > Tim Bunce <Tim.Bunce@pobox.com> writes:
> >
> >> On Mon, Sep 27, 2010 at 10:01:18PM -0700, Jan Dubois wrote:
> >>>
> >>> So I'm wondering if it would be better to have a more generic
> >>> ${^STATE} that could also indicate other states beyond global
> >>> destruction, e.g. inside BEGIN/INIT/CHECK/END blocks, or running
> >>> during sitecustomize.pl etc.  At the application level you can always
> >>> pass this information yourself, but an interpreter provided state
> >>> would help generic CPAN modules.  However, I've never needed these
> >>> other states so far, so maybe it is overkill.
> >>
> >> NYTProf could certainly make use of this.
> >
> > After not liking it initially, I've now been convinced.

+1 :)

> I like it too. Since your patches don't have docs yet I wrote up
> something that we might want to include in perlvar.pod in altered
> form:
> 
>     http://gist.github.com/607990
> 
> It shows the value of ${^PHASE} in various phases of compilation and
> execution. The example could be improved since the value of the
> $::WHERE variable isn't always accurate (it's set in phase.pl before
> some stuff in Module.pm finishes)

You could also demo/test the DESTRUCT phase by having an object that
refers to itself. Its DESTROY would then be called in the DESTRUCT phase.

Tim.

Thread Previous | 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