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) { ... }

For PHP mail() see various modules on CPAN, for example Net::SMTP.