Skip Menu |

This queue is for tickets about the MailTools CPAN distribution.

Report information
The Basics
Id: 23472
Status: resolved
Priority: 0/
Queue: MailTools

People
Owner: Nobody in particular
Requestors: rjbs [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: throw an exception on unknown ARG
If the "new" method can't identify the type of arg passed in, it ignores it and returns a blank method. This is a problem, especialy with the current filehandle detection, which can fail to properly detect IO::Handle-like objects. If an $arg is given, but its type cannot be determined, an exception should be raised. This patch does this. -- rjbs
Subject: unknown-arg.patch
diff -Nur MailTools-1.74/Mail/Internet.pm MailTools-rjbs/Mail/Internet.pm --- MailTools-1.74/Mail/Internet.pm 2006-01-21 04:16:10.000000000 -0500 +++ MailTools-rjbs/Mail/Internet.pm 2006-11-17 20:37:07.000000000 -0500 @@ -71,6 +71,10 @@ $me->read_header($arg) unless exists $arg{Header}; $me->read_body($arg) unless exists $arg{Body}; } + else + { + Carp::croak "couldn't understand argument to Mail::Internet constructor"; + } } return $me;
I am really hesitating to include any changes in the MailTools modules, because there is such an incredible amount of dirty legacy code using it. However, today I am in a strong mood, and will include your modifications (although in most cases slightly modified for various reasons)