foreach my $embeddedDoc ( $DocumentBody->{EmbeddedObjects} ) { my $edocType =$embeddedDoc->{Type}; if ( $edocType eq 'EMBED_ATTACHMENT' ) { print "Embedded Attachment!\n"; } elsif ( $edocType eq 'RICH_TEXT' ) { print "Some sort of Rich Document\n"; } else { print "Unknown Attachment! [ $edocType ] \n"; } }