I wrote a script to retrieve the filename from the attachment of an email. (by use of Encode::MIME::EncWords module.
$fname= decode('MIME-EncWords',$subentity->head->mime_attr('content-ty
+pe.name'));
If the email message is correctly format. It is OK to retrieve the filename.
But if the email message is broken and missing the filename attribute. It will trigger error in EncWords module and exit.
Use of uninitialized value $str in scalar assignment at /usr/share/per
+l5/vendor_perl/Encode/MIME/EncWords.pm line 61.
Use of uninitialized value $str in pattern match (m//) at /usr/share/p
+erl5/vendor_perl/Encode/MIME/EncWords.pm line 62.
Can I identify missing attribute of broken email message within my script and I handle this error.