Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: file is replaced

by colwellj (Monk)
on Nov 30, 2009 at 22:49 UTC ( [id://810277]=note: print w/replies, xml ) Need Help??


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

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://810277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-18 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found