Gotcha, yes, I dug around in the Parser.pm to have a look at that sort of stuff. For example, here is the part dealing with binary attachments:

$bin_ent->head->mime_attr('Content-type.x-unix-mode' => "0$mode"); $bin_ent->bodyhandle($self->new_body_for($bin_ent->head)); $bin_ent->bodyhandle->binmode(1) or die "$ME: can't set to binmode: $! +"; my $io = $bin_ent->bodyhandle->open("w") or die "$ME: can't create: $! +"; $io->print($bin_data) or die "$ME: can't print: $!"; $io->close or die "$ME: can't close: $!";

And here is the part dealing with text attachments:

$txt_ent->bodyhandle($self->new_body_for($txt_ent->head)); my $io = $txt_ent->bodyhandle->open("w") or die "$ME: can't create: $! +"; $io->print(@$preamble) or die "$ME: can't print: $!"; $io->close or die "$ME: can't close: $!";

So it occurred to me: "Hmm! If I add in code to force the text to use binary like this..."

$txt_ent->bodyhandle($self->new_body_for($txt_ent->head)); $txt_ent->bodyhandle->binmode(1) or die "$ME: can't set to binmode: $! +"; my $io = $txt_ent->bodyhandle->open("w") or die "$ME: can't create: $! +";

Unfortunately it didn't work, leading me to conclude that I don't know enough about the code at this time to be dealing with changing the guts of an existing perl module.

Technically I could copy and recreate it under the name of MIME::MyParser and see if I could manage to hack that into submission - however it seemed more than I was capable of managing if I couldn't even change the existing code. It was at this point that I decided it was easier to hack the input-file to trick the parser into doing what I want it to do.

Cheers,
William


In reply to Re^7: Is it possible to force MIME::Parser to extract text-files on a Windows system without the extra CR's on the end of lines? by WilliamDee
in thread Is it possible to force MIME::Parser to extract text-files on a Windows system without the extra CR's on the end of lines? by WilliamDee

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.