I don't know if this is causing your problem, but output to console on Win32 is really messed up if you run the script by just typing its name (without 'perl'). Try for example echoing a lot of stuff and redirecting it to a file. A couple of lines works, but if you try to redirect a lot of output, only a part will get redirected.
If this is an option for you, you can either execute the script with 'perl', so
or you can convert the script to a 'bat'-file using pl2bat
. It wraps your Perl script in a 'bat'-file.
I am interested if this will do the trick.