output asked headers in the order they were asked; avoid header name spoofing by...
[hband-tools.git] / user-tools / mime_extract
blobeb2079763d8293f4e6f07b32646276470f52db9c
1 #!/usr/bin/env perl
3 use MIME::Parser;
4 use warnings;
6 $|++;
8 if(not $outputdir = shift @ARGV or $outputdir eq '--help') { die "Usage: $0 [directoy to save] [files...]\n"; }
9 die "Directory is not writable: $outputdir\n" if ! -w $outputdir;
11 $parser = new MIME::Parser;
12 $parser->output_dir($outputdir);
15 for my $filename (@ARGV)
17 $entity = $parser->parse_open($filename);
18 $entity->dump_skeleton;
22 __END__
24 =pod
26 =head1 NAME
28 mime_extract - Extract parts from a MIME multipart file and save them into separate files
30 =cut