You only open $fh somewhere down below in your xml_output routine, but use it all over the place. Most likely you're trying to write to $fh before having opened it. Most likely, this when your program reaches line 66.
In reply to Re^3: file is replaced
by Corion
in thread file is replaced
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |