in reply to Re^2: broken twig?
in thread broken twig?

The twig_purge in attachment will indeed purge everything before that element, meaning that the record_id, creation_ts, short_desc and delta_ts elements will be purged, but the (now empty) record will be kept. Is this what is causing you problems?

Maybe what you are looking for is just $attach->delete in the attachment handler, then $twig->purge in the record handler. If Scalar::Util is installed, then using delete will release the memory for the attachment (at least so it can be re-used by the Perl process).

Replies are listed 'Best First'.
Re^4: broken twig?
by gregaryh (Novice) on Sep 13, 2005 at 21:31 UTC

    That is exactly what I need ($attach->delete) THANK YOU!!!

    btw, The XML::Twig module is absolutely awsome. It has greatly reduced the amount of work I need to do on this project (we had been using just plain old XML::Parser tree with a load of magic numbers to identify elements)

    Out of curiosity, is Scalar::Util installed with the base perl packages? cause I don't recall installing it separately but it seems to be on my system.

    Thanks again.

      I believe Scalar::Util was added to the core in 5.8.0 (according to perldoc perl58delta).

      And thanks for your kind words.