Re: Petal::Mail Encode

Colin Fallon <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <r02010100-1032-AEE1237A6A3011D88A080050E4A0463E@[192.168.200.4]>
>Well there is a CPAN module called Encode::Compat. You could try doing:
>
>use Encode::Compat;
>use Petal::Mail;
>
>and see what happens :)
>
>Cheers,
>Jean-Michel.

William & Jean-Michel,

Thanks for your replies. I had a look at Encode::Compat on cpan but
didn't go any further both because there was a warning in block caps
about it being a proof of concept and because it needs Perl 5.6.1 and
the ISP for the site in question is still on 5.6.

However, I tried removing use Encode altogether and also removing the
single line in Mail.PM which uses it:

$text = encode ('MIME-Header', $text);

This seems to work for the fairly simple e-mails which I am creating. If
you think removing this line will cause some dire problem of which I am
not aware, please warn me!!

I have also noticed that contrary to the documentation if you use the
Petal::Mail->send function you need to use a hash (i.e. a hashref
doesn't work). A suggested fix would be to replace the 2nd line of the
send function which currently reads:

my %args = @_;

with something like:

my %args = undef;
if (ref($_[0]) eq 'HASH') {
    %args = %{shift()};
}
else {
    %args = @_;
}

Cheers,
  Colin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.