Any ideas?

Yes, use the source Luke. The error is a croak() so it identifies the caller:

Entity.pm =1849= ### Get the encoding, defaulting to "binary" if unsupported: =1850= my $encoding = ($self->head->mime_encoding || 'binary'); =1851= my $decoder = best MIME::Decoder $encoding; =1852= $decoder->head($self->head); ### associate with head, i +f any

OK so the issue is with the call (better written as) MIME::Decoder->best($encoding)

Decoder.pm sub best { my ($class, $enc, @args) = @_; my $self = $class->new($enc, @args); if (!$self) { usage "unsupported encoding '$enc': using 'binary'"; $self = $class->new('binary') || croak "ack! no binary decoder!"; } $self; }

So you see that we try to create an object with the passed encoding, and if the call to new returns undef we warn about the unsupported usage and default to binary. Regardless of the initial $enc (could be binary or an unknown) we know we must be calling new() with an enc type of binary and that call is returning false. That's how we get to croak.

sub new { my ($class, @args) = @_; my ($encoding) = @args; my ($concrete_name, $concrete_path); ### Coerce the type to be legit: $encoding = lc($encoding || ''); ### Get the class: ($concrete_name = $DecoderFor{$encoding}) or return undef; ($concrete_path = $concrete_name.'.pm') =~ s{::}{/}g; ### Create the new object (if we can): my $self = { MD_Encoding => lc($encoding) }; require $concrete_path; bless $self, $concrete_name; $self->init(@args); } ### The stream decoders: %DecoderFor = ( ### Standard... '7bit' => 'MIME::Decoder::NBit', '8bit' => 'MIME::Decoder::NBit', 'base64' => 'MIME::Decoder::Base64', 'binary' => 'MIME::Decoder::Binary', 'none' => 'MIME::Decoder::Binary', 'quoted-printable' => 'MIME::Decoder::QuotedPrint', # snip ); sub init { $_[0]; }

Now I simply don't see how you can possibly get that error!!! Even if you delete the Binary.pm module! The only way that the new function can return undef is if 'binary' is not in %DecodeFor, or if $self->init(@args) returns undef (it should not for the obvious reason that it returns $self). All I can suggest is putting some debugging warns into the new function to localise the bug and checking the content of %DecodeFor with Data::Dumper just prior to its use. It is a global so perhaps something is stomping on it. That is the only really logical explanation. I can't replicate it on my system, nor would I expect to be able to.

cheers

tachyon


In reply to Re: no binary decoder! by tachyon
in thread no binary decoder! by NailBombJoe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.