http://www.perlmonks.org?node_id=1037603


in reply to Re^4: save output of program in another file
in thread save output of program in another file

To redirect the standard output, change how you run the program.:
# Without redirection: ./myscript.pl # With redirection: ./myscript > output.txt
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ