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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |