#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $hashref; print "exists\n" if(exists($hashref->{foo}->{bar})); print Dumper($hashref);