open FILE_LIST, "list.txt"; while() { #read each line into the array here -- gotta look up the syntax } close FILE_LIST; #### foreach $filename (@files2change) { my $backup = $filename . '.bak'; rename($filename, $backup) open OLD_FILE, $backup; open NEW_FILE, ">>$filename; while() { print NEW_FILE s/foo/bar/g; } close OLD_FILE; close NEW_FILE; }