Your code indenting is very difficult to follow. Try to use indenting-whitespace to make code more legible. perlstyle is a good guide to start with.
As for your problem, my recommendation is to check the return values of your various print statements like this:
print OUT "$1\n" or die "Couldn't print to OUT at line __LINE__:\n$!\n";You may be surprised to see:
Couldn't print to OUT at line 23: Bad file descriptor
With warnings turned on, are you seeing any warnings like...
print() on closed filehandle OUT at line 23.
I'm just making up 'line 23'... could be anything. The point is, I think you may be attempting to print to closed filehandles.
It's also possible that you're never satisfying the conditions of the if() block that actually prints to the files. Why not put in a little check with a print statement that prints "Printing to files...\n". That way at least you'll know whether or not you're entering the if block that does all the output.
Dave
In reply to Re: printing to filehandles
by davido
in thread printing to filehandles
by technofrog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |