I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-08-16 18:07:53-07 by mirod in response to 5894
Re: Determining if twig has been modified

At the moment there is nothing that tells you whether a twig was changed, and adding that would be both difficult and bad for performances. What you can do is set a flag in any piece of code that would modify the twig. Maybe you could even automate that to a point by using Hook::LexWrap or something similar. An other option is to subclass XML::Twig::Elt and to redefine the methods that are likely to be used to change the twig (once again, you could use Hook::LexWrap to do this automagically) so they set a flag. Saddly enough the complete list of those methods doesn't exist, and is pretty long. Plus what happens if, for example, you cut an element and then paste it back in the same position?

If you posted a detailed example, I could probably suggest some other ways to do this (how about diffing the input xml and the output, if they aren't too big?).

--
mirod

Direct Responses: 5916 | Write a response