perl script.pl >output.txt 2>errors.txt #### perl script.pl >output.txt 2>&1 #### perl script.pl 2>&1 | tee stdout.txt