You are using strict without declaring your variables ($dir1). Put a 'my $dir1;' someplace that makes sense so that Perl knows what your variable is. See perldiag for more details about this message
You are using backslashes in double-quotes, which will be interpolated. Either use single-quotes or escape your backslashes by doubling them: 'e:\whatever\whatever' See qq/q in perlop for details about how this works.