#!/usr/bin/perl use strict; use warnings; BEGIN { # find own workdir; only for test! use FindBin qw<$Bin>; } use MIME::Parser; my $parser = new MIME::Parser; $parser->output_dir("$Bin"); $parser->decode_headers(1); my $entity = $parser->read(\*DATA) or die "couldn't parse MIME stream"; __DATA__ Date: Wed, 28 Dec 2016 10:53:45 +0100 From: GwenDragon Message-ID: <1756562639.20161228105345@gwendragon.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----------04D1960FE3E3E8716" ------------04D1960FE3E3E8716 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit TEST ------------04D1960FE3E3E8716 Content-Type: text/plain; name="=?windows-1252?Q?=E4=F6=FC=DF=80=2Etxt?=" Content-transfer-encoding: base64 Content-Disposition: attachment; filename="=?windows-1252?Q?=E4=F6=FC=DF=80=2Etxt?=" xNbc34A= ------------04D1960FE3E3E8716--