Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: XML-Twig: more efficient tree processing

by mirod (Canon)
on Aug 07, 2012 at 16:58 UTC ( #986032=note: print w/replies, xml ) Need Help??

in reply to XML-Twig: more efficient tree processing

Is there a way to do this during the foreach loop?

most likely

That's about all I can say based on the information you gave. To really answer the question, I would need to see a little bit of code. Do you set handlers on typeC? From your explanations I half-suspect you load the entire tree in memory, but really I have no way to know.

  • Comment on Re: XML-Twig: more efficient tree processing

Replies are listed 'Best First'.
Re^2: XML-Twig: more efficient tree processing
by zuma53 (Beadle) on Aug 07, 2012 at 17:59 UTC

    Here's the nutshell version of what the code does:

    my $twig = new XML::Twig ( TwigRoots => { 'tables/table' => \&processColum +ns, 'views/view' => \&processColumns + } ); $twig->parsefile($SCHEMAS); $twig->dispose; sub processColumns () { my( $twig, $tableTwig ) = @_; my @colList = $tableTwig->find_nodes ("columns/column"); foreach $x (@colList) { blah; } }
      Do you have a $twig_.purge at the end of processColumns?

        For what I am doing, I am pretty much done with the processing once I hit the end of processColumns.

        Is there a way to free up things while I am in the processColumns loop?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986032]
[1nickt]: Gotya.
[LanX]: hmm reviews have no vote button?
[1nickt]: I use many books for purposes other than that for which they were written: decoration, paperweight, coffee mug coaster on the good table ...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2017-11-17 21:45 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (274 votes). Check out past polls.