One rule of thumb for perl programming improvement is that if you are writing pretty much the same code over and over again in your program, you have the potental to do a lot of improvement in your program. Namely, in your case, you've got the switch block... if you take your header variables and move them into a hash, you can rewrite that as...
if (@$MsgContent[$count] =~
/^(To|From|CC|Date|Subject|Message-ID)\s*:\s*(.*)$/ )
{
$MsgHash{ $1 } = $2;
print "$1 : $2";
}
(The extra \s* before the : in the regex may be bad, but I can't recall if the specs allow a space there or not)
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain