Last active
January 15, 2016 18:56
-
-
Save ericychoi/f35a19519d5e24ca8869 to your computer and use it in GitHub Desktop.
SImple MIME Parser from STDIN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/perl/bin/perl | |
use MIME::Parser; | |
use strict; | |
use warnings; | |
my $parser = MIME::Parser->new(); | |
$parser->output_to_core(1); | |
$parser->decode_bodies(1); | |
my $entity = $parser->parse(\*STDIN); | |
$entity->print_header(); | |
print "\n"; | |
for my $part ($entity->parts()) { | |
print $part->bodyhandle()->as_string(); | |
print "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment