use strict; use CGI ':standard'; use XML::Simple; use Data::Dumper; #Variables my $newval = '200'; my $var1; my $oldval = '200'; my $prodid = '8080'; my $temps; print header; my $arrays = [qw/content subcategory packaging_qty recipe description product paragraph comments channel brand conditionning product_id heading photo/]; my $cat = (); my $category = XMLin( $cat, keyattr => 1, forcearray => $arrays); print Dumper($category); print "Yes work\n"; foreach my $subcategory (@{$category->{'subcategory'}}) { foreach my $product (@{$subcategory->{'product'}}) { foreach my $product_id (@{$product->{'product_id'}}) { if ($product_id eq $prodid) { foreach my $conditionning (@{$product->{'conditionning'}}) { foreach my $content (@{$conditionning->{'content'}}) { #$temps = $conditionning; if ($content eq $oldval) { $content = $newval; XMLout($category, xmldecl => '', rootname =>'category', outputfile =>('C:\Program Files\Apache Group\Apache2\htdocs\legastronome\XML\Admin\test9.xml')); print"

All done!

"; print "\n"; exit 1; } else { print "$temps" } } } } } } } #### 150 years of know how at the service of a same strategy: Taste images/bag_legal.jpg images/prestige.jpg Coffee 33 D A 250 aaaa 12 8080 /recipes/coffee1.html