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 uninialised variable on tied hashed, but not untied hashes. #1880
Comments
From mike@fysh.orgThis is a bug report for perl from mike@fysh.org, The following code does not generate a warning: #!/usr/bin/perl -w $cheese{"cake"}=undef; However, the following code does: #!/usr/bin/perl -w use DB_File; tie %cheese, 'DB_File', "fred"; $cheese{"cake"}=undef; I get a "Use of uninitalized variable" warning, which is a shame, because it Cheers, Site configuration information for perl 5.00503: Configured by torin at Mon Mar 27 07:50:39 PST 2000. Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Locally applied patches: @INC for perl 5.00503: Environment for perl 5.00503: |
From [Unknown Contact. See original ticket]Mike Ashton <mike@fysh.org> wrote
That doesn't work. DB_File only supports strings as hash values, not
To avoid the warning, write instead $cheese{"cake"}=''; If you really need to distinguish between undef and '', you're out of Mike Guy |
From [Unknown Contact. See original ticket]
Just how do you expect DB_File to store undef in a file? For both in-memory and on-disk hashes, a give key will exist or not exist. The docs for DB_File say nothing about the ability to store a value of |
From @askNot a bug. -- |
@ask - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#3148 (status was 'resolved')
Searchable as RT3148$
The text was updated successfully, but these errors were encountered: