in reply to Printing Warning Messages Into a File

Warning messages don't go to STDOUT, and the redirection you're using only redirects STDOUT to a file. This is typically a good thing, since it's nice to be able to have all of your prints, for example, be saved in a file while your warnings are not.

You can either use the shell to redirect such warnings to a file, as others have explained, or in your code you can set up a signal handler for warnings:

open WARN, '> warnings.txt' or die ("Cannot write warnings.txt: $!"); local $SIG{__WARN__} = sub { print WARN @_,"\n" };

Or, even easier IMO, redirect STDERR, so that everything written there (which includes warnings) will be written to a file.

open WARN, '> warnings.txt' or die ("Cannot write warnings.txt: $!"); *STDERR = *WARN;
<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law