Subject: | patch to allow for objects inherited from Mail::Internet |
I have some code that would quite like to use Mail::LocalDelivery for things derived from Mail::Internet (we're hanging some extra methods off to the side for convenience). Here's a patch which saves having to do some awful dclone/rebless boilerplate.
diff -urb Mail-LocalDelivery-0.1/LocalDelivery.pm Mail-LocalDelivery-0.1~/LocalDelivery.pm
--- Mail-LocalDelivery-0.1/LocalDelivery.pm 2002-06-07 14:37:47.000000000 +0100
+++ Mail-LocalDelivery-0.1~/LocalDelivery.pm 2003-03-16 01:10:08.000000000 +0000
@@ -108,7 +108,7 @@
my $self;
# What sort of stuff do we have?
- if (ref $stuff eq "Mail::Internet" or ref $stuff eq "MIME::Entity"){
+ if (UNIVERSAL::isa( $stuff, "Mail::Internet" ) or UNIVERSAL::isa( $stuff, "MIME::Entity" )){
$self = $stuff;
} elsif (ref $stuff eq "ARRAY" or ref $stuff eq "GLOB") {
$self = new Mail::Internet($stuff);