Aha, yes, that too. I'd forgotten that one - thanks.
I'm surprised no-one has yet pointed out that piping to sendmail might not be the best way of sending a mail. I tend to prefer Net::SMTP as it is more portable.
But it depends what the OP has available, or was trying to achieve, I guess.