in reply to Malformed Headers due to using scalar for address

Did you mean to single quote the variable?
open (MAIL,"|mail $mail") || die "mail problem : $!";

update: added parens per Chmrr's point below
  • Comment on Re: Malformed Headers due to using scalar for address