#!/usr/bin/perl use strict; while () { if (/^\/ ... /^\<\/differentiation\>/ ) { s/\<.*\>/new/g if ! ( /\/ || /\<\/differentiation\>/ ); print; } } __DATA__ Dedication Dedication