develooper Front page | perl.perl5.porters | Postings from March 2016

[perl #127712] defined on HashofHash defines an element in the hash

Thread Next
From:
Philipp Berninger
Date:
March 15, 2016 12:47
Subject:
[perl #127712] defined on HashofHash defines an element in the hash
Message ID:
rt-4.0.18-24665-1457973935-614.127712-75-0@perl.org
# New Ticket Created by  Philipp Berninger 
# Please include the string:  [perl #127712]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=127712 >


Checking 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


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About