the use of removeChild() in Tree::Simple

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I am currently using Tree::Simple module.

I originally have a tree x. My task is to insert a node G into x, so
that the B node under A go under G.

My solution is: I create G first, then G->addChild(B). then disconnect
B from A, finally A->addChild(G).

           /       \
         B        E...
         /\         |
        C D      F...
          /       \
         G        E...
          |         |
         B        F...
        C D
But it seems the disconnection can't be achieved by using
removeChild(), according to the specification,
"When a child is removed, it results in the shifting up of all
children after it, and the removed child is returned."
That is, if i delete B from x, the tree will look like this. It is
difficult for me to A->addChild(G) to this intermediate tree.
          / \      \
         C D     E...

Any suggestions? //P.S. I prefer a solution in which the nodes are
relocated rather than being removed and regenerated.

Site Timeline