in reply to Does Perl have some php equivalents?
I think there is no need for PHP empty() in Perl.
You can simply write:
if ($var) { ... } [download]
For PHP mail() see various modules on CPAN, for example Net::SMTP.