in reply to mail in script... how to add subject and from:

Danger! Definitely go with one of the solutions already presented in this article, not only because it's more portable and simpler, but they're all more secure. It looks as though you are using potentially unsafe user-provided data in your system command, which is potentially disastrous. Please read perlsec and try running your stuff with the -T Perl option to ensure you aren't allowing any Joe Hacker to run any command on your system that he wants.