#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %one = ( color => "red" ); my $two = { color => "blue" }; print "Bogus\n" if exists $one{shape}{box}; print "Bogus\n" if exists $two->{shape}->{box}; print Dumper \%one, Dumper $two;