#! /usr/bin/perl use strict; use warnings; use Email::Simple; use DBI; use File::Copy; use Date::Parse; use DateTime; use Path::Tiny qw(path); [..] open (MESSAGE, "< $ARGV[0]") || die "Couldn't open email $ARGV[0]\n"; undef $/; $raw_email = <>; close MESSAGE; my $mail = Email::Simple->new($raw_email); my $from_header = $mail->header("From"); my $to_header = $mail->header("To"); my $date_header = $mail->header("Date"); my $aol_header = $mail->header("Authentication-Results"); [...]