I'm writing a script that needs to send an email and FTP a file and would like to know the differences between spawning a shell to carry out the necessary command and using an equivalent Perl module or program API.
Which is more secure? Are there any noticeable performance advantages or other issues? How easy is it to take advantage of the security holes? Is one method more reliable than the other?
My script needs to be secure - should I spawn sendmail and FTP commands or use Mail::Sendmail and Net::FTP?