Subject: | bug in v3.021 of MIME::LIte |
Date: | Mon, 28 Apr 2008 16:16:51 -0400 |
To: | bug-MIME-Lite [...] rt.cpan.org |
From: | craig [...] constantine.name |
v3.021 specifies 'use strict' but line 1695 emits a warning from within scrub()
when $self->{Attrs}{'content-type'} has an associated value (eg, 'text/plain')
rather than being a hash ref. Specifically:
Can't use string ("text/plain") as a HASH ref while "strict refs" in use
at /usr/local/share/perl/5.8.8/MIME/Lite.pm line 1695, <DATAFH> line 4.
I think the change below would be an improvement (at least, it fixes my
problem) that would still accomplish what you were intending.
Thanks,
-c
--- Lite.pm.ORIG 2008-04-18 16:25:23.000000000 -0400
+++ Lite.pm 2008-04-18 16:58:02.000000000 -0400
@@ -1692,7 +1692,7 @@
}
### TBD: this is not really right for message/digest:
- if ( ( keys %{ $self->{Attrs}{'content-type'} } == 1 )
+ if ( scalar($self->{Attrs}{'content-type'})!~m/^HASH/
and ( $self->_safe_attr('content-type') eq 'text/plain' ) )
{
$self->replace( 'content-type', '' );