Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Nine is quite a bit more elaborate though. Notable differences:

    sysopen my $fh, $fn, O_WRONLY | O_EXCL | O_CREAT
        or die "Couldn't open $fn for writing: $!\n";

    so I don't get stuff inadvertantly overwritten. Also,

    for( $msg->parts ) {
        my $fn = $_->filename;
        next if not defined $fn;
        # ...

    so I don't have to look at MIME types — that way only seemed to lead to madness. (What're you passing a parameter to ->filename() for btw?)

    Other reasons for its length include a folder processing mode, ability to read files passed to it on the command line, and more. I have it nearly PODded up and everything, too — should probably put it online somewhere. Not that it's a huge amount of work, but I like to make small but shiny tools. :-)

    I have noticed that Perl gets all flustered if you try to throw excessively large folders at it, though. :-( It works very fine from my .procmail though. Email::MIME [] is quite a fine module indeed, along with all the other nuggets the Perl Email Project turned out.