Add a flag to mail : I am developing a perl script in which I need to have a flag in which I accept an email id and then the entire output of the script should be sent to that email id. Any suggestions?

./script -mail xyz@gmail.com