in reply to Perl XPath

Try this. It takes 3 seconds to update a generated file containing 1000 books (2000 titles):

#! perl -slw use strict; use Data::Dump qw[ pp ]; use XML::Simple; my $start = time; my $xml = XMLin( \*STDIN, KeepRoot => 1 ); #pp $xml; for my $book ( 0 .. $#{ $xml->{catalog}{book} } ) { my $titles = $xml->{catalog}{book}[ $book ]{ titles }{ title }; for my $title ( 0 .. $#{ $titles } ) { my $txt = $titles->[ $title ]; $txt =~ s[(\d+)]{ $1+1 }e; $titles->[ $title ] = $txt; } } print XMLout( $xml, KeepRoot => 1, NoAttr => 1 ); warn time() - $start; __END__ C:\test>junk < junk.dat >junk2.dat 3 at C:\test\junk.pl line 22.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?