This is very simple, but it happens often and I have to write extra code to handle it :
use Data::Dumper; my $hashref; print Dumper $hashref; if(exists $hashref->{a}->{b}) { # Do something } print Dumper($hashref);
Of course, at the first print $hashref is undef, but after the exists statement $hashref is now: { 'a' => {} } Why ?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |