use File::Find; use strict; my $bak_ext = '.bak'; my $root_dir = 'C:/Temp/Chris/Bills/'; find(\&wanted, $root_dir); sub wanted { # if the extension fits... if ( /\.xml?/i ) { print "Processing $_\n"; my $new = $_; my $bak = $_ . $bak_ext; rename $_, $bak or die "Cannot rename $_ to $bak: $!"; open OUTPUT, "> $new" or die "Cannot open $new for writing: $!"; while ( ) { my $TheLine = $_; s/Draft/Scrap/i; s/