-
Notifications
You must be signed in to change notification settings - Fork 540
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
defined on HashofHash defines an element in the hash #15231
Comments
From phberninger@gmx.netChecking with defined for an Hash of Hash element defines the element in the hash, instead of returning undefined: The following code will reproduce it:
perl -e 'if(defined($foo{"a"}{"b"})){ print "not defined\n";}if(defined($foo{"a"})){ print "ERROR? now defined?\n";} '
I hope it is not a feature. tested with perl 5.20.2 under Linux |
From @tonycozOn Mon Mar 14 09:45:35 2016, phberninger@gmx.net wrote:
This is a known problem[1], and is difficult to fix because the change would break existing code. You can avoid this behaviour by using the autovivication module from CPAN. Tony [1] that autovivication doesn't always respect lvalue vs rvalue |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Mon Mar 14 09:45:35 2016, phberninger@gmx.net wrote:
I do not believe this is a bug. The test for definedness of $foo{a}{b} in the first 'if' block autovivifies $foo{a}, -- |
From @jkeenanOn Mon Mar 14 15:36:44 2016, jkeenan wrote:
That post was incomplete. See attached. -- |
From @pjcjOn Mon, Mar 14, 2016 at 03:31:02PM -0700, Tony Cook via RT wrote:
Break, in the sense of altering. But this is the case for all bug This surprising autovivification in what does not at first--or even Now, this bug has existed for a long time and therefore is in a slightly If that is the case, then the documentation should be updated to reflect If we would still like to fix it but cannot at the moment, for some Which case do we have here? -- |
From zefram@fysh.orgPaul Johnson wrote:
Yes, we should document that the (default) autovivification behaviour -zefram |
From @epaAnother possibility is to control the autovivification behaviour with -- |
From zefram@fysh.orgEd Avis wrote:
Absolutely. There is a prototype of this on CPAN, autovivification.pm, -zefram |
From @jkeenanOn Tue Mar 15 12:31:27 2016, zefram@fysh.org wrote:
Paul, zefram, et. al.: Could someone propose some wording for this documentation clarification? That would help move this ticket toward closing. Thank you very much. -- |
From zefram@fysh.orgJames E Keenan via RT wrote:
In perlfunc.pod, section on "exists", delete the paragraph This surprising autovivification in what does not at first--or even -zefram |
From @pjcjOn Thu, Apr 21, 2016 at 03:47:25AM +0100, Zefram wrote:
It is disappointing that this language wart seems to be here to stay. If not then yes, just deleting the caveat from the docs seems -- |
From zefram@fysh.orgPaul Johnson wrote:
Yes. A feature flag would be a fine way to switch to different -zefram |
From @pjcjOn Thu, Apr 21, 2016 at 12:18:41PM +0100, Zefram wrote:
In which case, perhaps, deleting the caveat from the documentation may -- |
From zefram@fysh.orgPaul Johnson wrote:
The caveat is warning about possible changes in behaviour of existing -zefram |
From zefram@fysh.orgDocumentation updated in commit d3f0c81. -zefram |
@cpansprout - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#127712 (status was 'resolved')
Searchable as RT127712$
The text was updated successfully, but these errors were encountered: