in reply to Re: file is replaced
in thread file is replaced

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: file is replaced
by colwellj (Monk) on Nov 30, 2009 at 22:49 UTC
    This is because you redefine $i in your sub and start from 0 each time.
    change;
    sub xml_output { my ($output, $tag, $fh,$i) = @_;
    to;
    sub xml_output { my ($output, $tag, $fh) = @_;
    This will give you 0.xml and 6.xml.
    This is because you increment $i each time you write a tag.
    Move the $i++ to just after your open statement to count correctly.