$file1 = s/(\W)/\\$1/; # and similarly for other filenames