in reply to Why isn't the file being produced?

Start taking stuff out of the script until you have the smallest piece of code that reproduces the problem. At that point, your problem will become very evident.

Also, if you want our help in debugging something, adding "use strict" and "use warnings" to the top of your script will go a long ways. That's the first thing we generally suggest, just because Perl is much better at debugging stupid errors than we are.