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
Inside perl -d in a loaded .pm file, a global lexical hash is empty in the second function that follows it #15027
Comments
From @shlomifHi all, this is what appears to be a bug that affects perl -d and that happens in all This should be easy to rework into a patch of a test (but without a fix). Regards, Shlomi Fish -- |
From @shlomif |
From @shlomif |
From @iabynOn Tue, Nov 03, 2015 at 05:32:25AM -0800, shlomif@shlomifish.org wrote:
This is normal closure behaviour. Here's a simpler example that doesn't { outputs: f1: x=1 After $x has gone out of scope, it can only be seen by subs that have In your original example, the lexical goes out of scope after the .pm file -- |
The RT System itself - Status changed from 'new' to 'open' |
From @shlomifHi Dave, thanks for your reply. That put aside, rt.perl.org/rt.cpan.org/etc. should really: 1. Provide a WWW "http://" hyperlink back to the bug report's web page in the 2. Make sure it doesn't keep logging one's out repetitively after one closes Both of these problems make for a bad user-experience for me when using See below for the rest of my reply. On Fri, 6 Nov 2015 03:31:02 -0800
I see. It seems like an undesirable behaviour to me. Is it done this way due to Regards, Shlomi Fish -- Shlomi Fish http://www.shlomifish.org/ Chuck Norris has conceived a master plan that does not involve building a time Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @iabynOn Thu, Nov 12, 2015 at 01:18:00PM +0200, Shlomi Fish wrote:
I have no involvement with the RT infratructurem, so cant rally comment on
It's a basic property of closures, and it's desirable, to avoid lots of package Foo; sub bar { eval '$x' } In perl currently, the $x lexical is created at the time Foo.pm is Variable "$x" is not available at (eval 1) and will return an undef value. If perl were to delay freeing $x in case some sub in the current scope If that sub were written as sub bar { $x; eval '$x' } then it becomes a closure, closing over $x; and in this case, the freeing -- |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#126552 (status was 'rejected')
Searchable as RT126552$
The text was updated successfully, but these errors were encountered: