print "Oh No!(3)" if exists $rec{NOTE}{Nested}; print "Oh No!(4)" if exists $rec{NOTE}; OUTPUT: Oh No! (4)