#!/usr/bin/perl use strict; use MIME::Parser; my $file = shift; open(IN,$file) || die "Cannot read input file: '$file'"; my $parser = new MIME::Parser; my $entity = $parser->parse(\*IN) or die "parse failed\n"; close(IN);