develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #119049] referencing some variables hides others from PadWalker starting 5.17.2

Thread Previous | Thread Next
Father Chrysostomos via RT
July 31, 2013 00:55
[perl #119049] referencing some variables hides others from PadWalker starting 5.17.2
Message ID:
On Tue Jul 30 17:43:09 2013, demerphq wrote:
> On 31 July 2013 01:05, Father Chrysostomos via RT
> > In short: closures close over variables, not lexical scopes, unless
> > string eval is involved.  (So one can work around this by including eval
> > "" in the sub.)
> >
> > I don’t think anything needs fixing here, so I am rejecting the ticket.
> >
> IMO if you have to include eval "" in your sub then there is something
> else wrong too.

How so?  PadWalker is peeking at perl internals and can see
implementation details.

In the presence of eval, perl cannot know which variables the sub is
going to close over, so it closes over all of them.  In its absence it
closes over only those it has to.

What I am saying is that PadWalker is a bit like B:  If the internals
change, then what you see through that interface changes, because there
is no abstraction.  We shouldn’t have to maintain that type of

> I'm not saying this argues against closing the ticket, but right now
> it is not clear to me that it should be.


Father Chrysostomos

via perlbug:  queue: perl5 status: rejected

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About