Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: XML::Twig - Filtering and duplexing output to multiple output files

by mirod (Canon)
on Nov 12, 2014 at 14:14 UTC ( [id://1106977]=note: print w/replies, xml ) Need Help??


in reply to Re: XML::Twig - Filtering and duplexing output to multiple output files
in thread [SOLVED] XML::Twig - Filtering and duplexing output to multiple output files

The problem in this case is the flush method, which does some light magic to output the parts of the tree that haven't been output yet, and then updates the state of the XML::Twig object (so the next call to flush Just Works™). You can't call it twice in a row, with 2 different filehandles, it wouldn't work. That's why using IO::Tee is a brilliant idea.

Replies are listed 'Best First'.
Re^3: XML::Twig - Filtering and duplexing output to multiple output files
by Discipulus (Canon) on Nov 13, 2014 at 08:47 UTC
    obviously the author is right!
    See indeed the docs about flush

    You cannot hack it using print or sprint because they have to be used AFTER parse. lesson learned. Thanks.

    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found