1

如何获得以下选项的路径?
基本上消息将被解析到由时间和进程 ID 组成的以下目录“/tmp/msg-1370789006-11903-0”,我如何将其放入我的变量中以供以后使用?

### Tell it where to put things:
    $parser->output_under("/tmp");
4

1 回答 1

0

发行版的整体文档(也可以在发行版的README文件中找到)包含以下有用信息:

 Overview of the classes

    Here are the classes you'll generally be dealing with directly:

        (START HERE)            results() .-----------------.
              \                 .-------->| MIME::          |
               .-----------.   /          | Parser::Results |
               | MIME::    |--'           `-----------------'
               | Parser    |--.           .-----------------.
               `-----------'   \ filer()  | MIME::          |
                  | parse()     `-------->| Parser::Filer   |
                  | gives you             `-----------------'
                  | a...                                  | output_path() 
                  |                                       | determines
                  |                                       | path() of...
                  |    head()       .--------.            |
                  |    returns...   | MIME:: | get()      |
                  V       .-------->| Head   | etc...     |
               .--------./          `--------'            |
         .---> | MIME:: |                                 |
         `-----| Entity |           .--------.            |
       parts() `--------'\          | MIME:: |           /
       returns            `-------->| Body   |<---------'
       sub-entities    bodyhandle() `--------'
       (if any)        returns...       | open()
                                        | returns...
                                        |
                                        V
                                    .--------. read()
                                    | IO::   | getline()
                                    | Handle | print()
                                    `--------' etc...

这导致我们查看 MIME::Body 的文档,其中包括以下内容:

### Where's the data?
if (defined($body->path)) {   ### data is on disk:
    print "data is stored externally, in ", $body->path;
}
else {                        ### data is in core:
    print "data is already in core, and is...\n", $body->as_string;
}

### Get rid of anything on disk:
$body->purge;
于 2013-06-09T17:24:20.743 回答