ok, I posted 2 weeks ago something about logging an attachment. this is what I could make with grand help of webfiend.
#!usr/bin/perl
use v5.8.0;
use warnings;
use strict;
use MIME::Parser;
my $parser = MIME::Parser->new();
$parser->output_under('/tmp');
my $entity = $parser->parse(\*STDIN);
if ( $entity->is_multipart ) {
for my $part ( $entity->parts ) {
my $head = $part->head;
if ( my $filename = $head->recommended_filename ) {
print "Attachment name: $filename\n";
}
}
}
I have 2 mails to test the system. the first gives the output what I want. the second gives this: Can't locate object method "binmode" via package "IO::File" at /usr/lib/perl5/site_perl/5.8.0/MIME/Body.pm line 437.
does anyone know how to solve this?