Tilde escape commands in mailx for instances. Data input needs to be
accurately checked to avoid abuses. That's the reason to avoid in general
the use of such a command. Moreoveri, perl has different proper and
powerful methods to send e-mail. There is no need to spawn a program
like that. So, that's also a stylistic issue.
I could not trick mailx (at least the debian version) to do something
nasty by command execution if it detects non-interactive mode. I've seen
in the sources that it checks on the basis of isatty() if it's in
interactive mode and that looks quite stable. So I don't think this is a
big issue.
Willi