in reply to Help with accepting inputs, wordcount, and print to a file
Look at perldoc -f print to see how to print to a file (or just redirect the output in your shell).
See also: