### Dump the ENCODED body data to a filehandle: $body->print(\*STDOUT); ### Slurp all the UNENCODED data in, and put it in a scalar: $string = $body->as_string; ### Slurp all the UNENCODED data in, and put it in an array of lines: @lines = $body->as_lines; #### for $part( @parts ) { my $type = $part->mime_type; my $bh = $part->bodyhandle; print "MIME Type: $type\n"; if ( defined $bh ) { open( my $OUTFILE, ">", "output.7z" ) or die $!; $bh->print(\$OUTFILE); close( $OUTFILE ); } }