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;