Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

XML-Twig problem with Perl 5.16

by zuma53 (Beadle)
on Jun 27, 2012 at 15:01 UTC ( #978688=perlquestion: print w/ replies, xml ) Need Help??
zuma53 has asked for the wisdom of the Perl Monks concerning the following question:

Hi--

I installed Perl 5.16 64-bit and XML-Twig 3.40 on my system and it seems that the code I had that was working, now does not.

Specifically, when I am doing
my $twig = new XML::Twig; $twig->parse('<objects />'); $root = $twig->root; ...loop... my $object = new XML::Twig; $object->parse('<object />'); $objRoot = $object->root; ...build object xml... $objRoot->paste('last_child', $root);
What's happening is that the first paste to objects works, but all the subsequent pastes do not.

This works fine in 5.14 and if I revert back all is fine.

Has anyone run into this?

Thanks.

Comment on XML-Twig problem with Perl 5.16
Download Code
Re: XML-Twig problem with Perl 5.16
by Anonymous Monk on Jun 27, 2012 at 15:12 UTC
      Yes, I think that the real problem is that the dependency-list as used by CPAN is not complete. Modules (like these) that need to get upgraded, don't automatically get upgraded (or recompiled) as they ought to.

        Yes, I think that the real problem is

        trolls

        OIC. All I did was an out-of-the-box install. That is, getting a copy of 5.16 from ActiveState and using PPM to download XML-Twig. This had been what I have been doing and have never had a problem.

        I thought something had changed in 5.16 that stopped Twig from working properly.

        Thanks.
Re: XML-Twig problem with Perl 5.16
by sundialsvc4 (Abbot) on Jun 27, 2012 at 22:21 UTC

    That really isn’t “trolls.”   The OP does not say exactly how he went about switching Perl versions (and then, apparently, switching back ...) but it nevertheless is true that there’s a lot of package-interdependency and, within almost each and every package, a fairly substantial chunk of XS (that is, “C[++]”) code.   Including, maybe, stuff that talks to the Perl interpreter’s perlguts.   If there should happen to be any sort of mismatch or incompatibility there ... well, it might cause a binary-explosion or ... it might not.   What it certainly could cause is, “it works in one version of Perl (on my computer, as I am running it) but not the other (ditto).”   I frankly would not expect that differences between the two Perls, e.g. at a language/syntax level, would be the root-cause, i-f the package in question (taken by itself) has been certified against that version.   It rings true to me.

      That really isn’t “trolls.”

      Great, more obtuse trolls with irrelevant nonsense junk

Re: XML-Twig problem with Perl 5.16
by mirod (Canon) on Jun 28, 2012 at 04:19 UTC

    In 5.14 are you sure you are using XML::Twig 3.40?

    In previous versions of the module there was a bug that would let you paste the root of an XML::Twig object without cutting it first. It looks like it is the case here, when you paste $objRoot.

    On a side note, you may want to write XML::Twig->new instead of new XML::Twig, search the web for perl indirect object syntax if you want to know why.

      In my 5.14 version, Twig 3.39 is installed there.

      Thanks.

        There you go then, you should either fix the bug by cutting $objRoot before pasting it, or wait for XML::Twig 3.41 which should allow for the old behaviour to work.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://978688]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2014-12-18 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (59 votes), past polls