fork download
  1. use strict;
  2. use warnings;
  3. use Data::Dumper;
  4.  
  5. my %hash = ();
  6.  
  7. if (exists $hash{nonexistent}) {
  8. print "Something is REALLY wrong\n";
  9. }
  10.  
  11. if (exists $hash{vivificated}->{nonexistent}) {
  12. print "OH SHI~\n";
  13. }
  14.  
  15. if (exists $hash{vivificated}) {
  16. print "Just as planned ;)\n";
  17. }
  18.  
  19. print "The hash is: " . Dumper(\%hash);
Success #stdin #stdout 0.02s 5084KB
stdin
Standard input is empty
stdout
Just as planned ;)
The hash is: $VAR1 = {
          'vivificated' => {}
        };