in reply to Re: Dealing with "Detachments"
in thread Dealing with "Detachments"
For actual use I'd create the directory internally from the program and then remove it when finished. You'll also want to come up with some dynamic means of choosing the directory name since you don't want to try and delete the directory while another instance of the program is trying to write to it.use strict; use warnings; use MIME::Parser; ## my alias line: ## menu: \menu, "|/usr/perl/mime.parser.p" ## '\menu' keeps a copy in the inbox for account menu my $parser = new MIME::Parser; ## The secret here is that the directory must pre-exist ## and must be writable by the daemon that runs the ## parsing script. In my case user=daemon group=other ## I determined the correct values by initially making ## /tmp/mimemail using permissions 777. $parser->output_dir("/tmp/mimemail"); my $entity = $parser->read(\*STDIN) or die "\n\nCouldn't parse MIME stream\n\n";