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

Re^3: XML::Twig to mysql totally lost

by mirod (Canon)
on Jul 15, 2011 at 07:48 UTC ( #914519=note: print w/replies, xml ) Need Help??

in reply to Re^2: XML::Twig to mysql totally lost
in thread XML::Twig to mysql totally lost

You are probably using a RedHat-based distribution, which includes Scalar::Util without its XS part, and so doesn't provide weaken (see Task::Weaken). The solution would be to re-install Scalar::Util, from CPAN.

Also, I am not sure why you do a $twig->flush; at the end of your code, since you are not outputting the XML at all.

Replies are listed 'Best First'.
Re^4: XML::Twig to mysql totally lost
by bcnagle (Novice) on Jul 15, 2011 at 07:54 UTC
    I am very new to this, from what the tutorial showed, i added it in, i didn't think i needed it either since it's a cron and not outputting but want to keep memory to a minimum consumption. Should i remove it? From what the code shows, is it for certain looping then clearing the previous parse after uploading to the database? want to make sure I'm on the right path.

      The purge in your handler releases the memory by deleting everything but the direct ancestors of the current element. The flush is used when you want to output the transformed XML, by using flush in handlers. Then you need to flush what remains in memory after you're done parsing. At least with old versions of the module, recent versions take care of this automatically.

      So the short answer is: yes you can delete it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://914519]
[marinersk]: choroba++
[choroba]: it's a long running test, so it's normally skipped unless an env var is set
[choroba]: nobody has been bothered to set the variable in the last 3 years
[marinersk]: sub newtest{my $expected_result = &target('foo'); my $actual_result = &target('foo'); if ($actual_result eq $expected_result) { &tdd_success(); } else { &tdd_fail(); } } # Test works after three years!
[choroba]: or nobody bothered...
[choroba]: The problem was bigger, as the test tried to call a method that didn't exist anymore
[marinersk]: :: ducking ::
[choroba]: because, someone renamed the method, but didn't notice it was used in the test, as the test was skipped
[marinersk]: Well, if the method doesn't exist, it would be hard to pass the test.
[choroba]: later, someone removed the new method, as all its usage places were safe, but didn't notice the test still used the old name

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2017-05-25 15:10 GMT
Find Nodes?
    Voting Booth?