Apart from what
$code or die said, there are a couple of other things.
Can you see anything wrong with this:
$mail_prog = "/usr/sbin/sendmail -t";
open(MAIL, "|$mail_prog -t");
Apart from the fact these variables don't have their scope declared
(see
strict and
my) you are passing sendmail two -t switches.
And the last thing, though it's no real problem, just a question of clarity and style is to use
a heredoc instead of multiple prints.
print MAIL <<"MESG";
To: $recipient
From: $sender
Subject: database entry
added
---------------------------------------------------
.
MESG