-
Notifications
You must be signed in to change notification settings - Fork 560
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
Use of uninitialized value within @_ in anonymous array ([]) #22884
Comments
Unrelated to Data::Dumper:
|
@mauke, am I correct in thinking that this ticket is Not a Bug, hence closable? |
Why do you think it's not a bug? |
That was simply my interpretation of the fact that you started off your reply with "Unrelated to Data::Dumper." But, given that Data::Dumper itself has warnings enabled, wouldn't we expect that warning? |
The first warning, yes. But as the reporter says:
I suspect this is caused by the hash element being in "potential lvalue" context (because it is a subroutine argument). If the hash element doesn't exist yet, it will be created on demand, but only if the subroutine assigns to |
Oooookay ... so what should we do about this. Would documenting the anomaly be sufficient? |
There is no hash lookup in the visible Perl code, so preferably we wouldn't emit a warning for code that the user didn't write. Not sure how feasible this would be to implement. |
This looks like #22423 |
Module: Data::Dumper
Description
Referencing a non-existent hash results in:
Steps to Reproduce
Original reproduction code:
Result:
This was shortened by Daniel Böhmer to:
$ perl -MData::Dumper -we 'my (%hash1,%hash2); Dumper($hash1{$hash2{key}})'
Result:
Expected behavior
The warning about "anonymous array" not to be there.
Perl configuration
The text was updated successfully, but these errors were encountered: