perl yourscript.pl >stdout.txt 2>stderr.txt