my $tag = 'conditionning'; my $newval = '200'; my $data = join('', ); $data =~ s/(<$tag[^>]*>)[^<]*(<\/$tag[^>]*>)/$1$newval$2/gi; print $data; __DATA__ 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