Reputation: 21
I am using Perl5 (revision 24 subversion 1) on linux.
use strict;
use warnings;
my $fruit_colors = {
'apple' => {'red' => 'good'}
};
print($fruit_colors->{'orange'}); # this prints nothing
print($fruit_colors->{'orange'}{'orange'}); # this prints nothing too
print($fruit_colors->{'orange'}); # but this suddenly prints 'HASH(0x1f63098)'
My question is why does this happen? and how to prevent it from causing unintential consequences.
Upvotes: 0
Views: 61