Although it's true you may not know what the file names are until MIME::Parser is done, you do have the option of specifying where to store the attachments beforehand:
my $dir = "./mimemail";
my $parser = new MIME::Parser;
my $entity = $parser->read(\*STDIN) || die "couldn't parse MIME stre
You should have enough information at this point to change permissions on the directory or the files within it. Then again, maybe I misunderstand your question. The suggestion by davis
should work in any case.