my $dom = 'XML::LibXML'->load_xml(IO => *STDIN); #### my ($other_title) = $dom->findnodes('//file/body/group/unit/alt-title/otherTitle[@origin="tilte"]'); #### a b c #### old old #### #!/usr/bin/perl use warnings; use strict; use XML::LibXML; my $new_values_file = shift; my $dom = 'XML::LibXML'->load_xml(IO => *STDIN); open my $in, '<', $new_values_file or die "$new_values_file: $!"; while (<$in>) { chomp; my ($two) = $dom->findnodes("/root/one[$.]/two[\@origin='a']"); $two->removeChildNodes if $two->findnodes('text()'); $two->appendText($_); } print $dom; #### perl script.pl 1 < 1.xml #### ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,