in reply to use XML::Twig to insert data in the correct order

I don't really see the problem here. You can perfectly insert the new record element in the right position, as long as the initial record set is sorted: that's just before the first record with a name greater than the inserted record name.

So add the following code to the handler, and voilą!

elsif( $record->field( 'name') g +e $x->field( 'name')) { $x->paste( before => $recor +d); $item_pasted=1; return }

Replies are listed 'Best First'.
Re^2: use XML::Twig to insert data in the correct order
by sureerat (Acolyte) on Nov 09, 2008 at 09:25 UTC
    Hello Mirod,

    Thank you for your suggestion. It's working well. I like XML::Twig, it's a great perl module. ^_^