c:\mydir
####
c:\\mydir
####
md c:\\mydir\yourdir
pushd c:\mydir\\yourdir
popd
####
print "Enter string: ";
$dirname = ;
#
# Must chop the string that the user entered,
# since mkdir won't accept a directory name
# that contains a newline character.
#
chop $dirname;
#
# This line is optional (at least on
# Win2K), since cmd.exe considers
# c:\mydir and c:\\mydir to be
# equivalent.
#
# So double the slashes or not,
# as you please.
#
$dirname =~ s{\\}{\\\\}g;
print "Creating . . . $dirname\n";
mkdir($dirname, 0777) || die "Couldn't create $dirname. Error: $!\n";