foreach my $embeddedDoc ( $DocumentBody->{EmbeddedObjects} ) { my $edocType =$embeddedDoc->{Type}; # Above returns a blank if ( $edocType eq 'EMBED_ATTACHMENT' ) { print "Embedded Attachment!\n"; } elseif ( $edocType eq 'RICH_TEXT' ) { print "Some sort of Rich Document\n"; } else { print "Unknown Attachment!\n"; } }