Barryet has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Encode::MIME::EncWords module
by huck (Prior) on Mar 18, 2020 at 16:30 UTC |