in reply to Save XML::Twig tree into *.xml file

looking at XML::Twig POD, the print ($optional_filehandle, %options) method can take a filehandle.. so this should work:
$captureTemplateTree = new XML::Twig(); $captureTemplateTree->parsefile($captureTemplateName); open my $fh, "/tmp/out.xml"; $captureTemplateTree->print( $fh );

Replies are listed 'Best First'.
Re^2: Save XML::Twig tree into *.xml file
by ramya2005 (Scribe) on Aug 17, 2005 at 20:39 UTC
    Thanks for your input!
    This works!
      But, we need to manually reload the document ? How can we save the document and reload the document as my application is still running.

        But, we need to manually reload the document ? How can we save the document and reload the document as my application is still running.

        Hi :) You're asking ramya2005 was last here 8 years ago :) and can't hear you. See on necromancy (reviving old threads) and The Perl Monks Guide to the Monastery

        If you want to ask everybody go to new question: Seekers of Perl Wisdom

        but the answer is simple, through the magic that is programming

        while( still_running() ){ do_whatever_you_want($file...) if that_is_what_you_want(); } sub do_whatever_you_want { my $twig ... anything you want }
        Naturally you will have to fill in the blanks :)