zoul handled the redirection stuff, so here's the amazingly complex answer on warnings.
Just call the program like so: perl -w script.pl
This forces warnings to be enabled everywhere in the script and all modules. It is really better to use the warnings pragma in every module you write. See perldoc perllexwarn for more info on this subject.
Another trick that is nice when debugging is to use Carp::Always. If forces a complete stack trace on every error. I find this very very helpful. Simply run your script like so:
perl -MCarp::Always somescript.pl
or to get it into a file:
perl -MCarp::Always somescript.pl 2&> somefile.txt
And finally, I'll digress from your question a bit more. Many people like to instrument their code by using a logging library like Log4Perl. Tools like this let you enable logging at a certain level (normal or debug for example) or over specific parts of your application on individual runs of your code. This is the final(?) evolution of the debugging print statement. It can be quite useful in debugging failures while in development, and in the field once you have reached the maintenance phase.