open my $fh, '>', 'path to windows folder'; write $fh 'This is a test'; close ($fh) #### # $schoolName and $bar are set elsewhere, but basically 'AHS' and 'XYZ' # hotBase is "D:/home/cristofa/public_html/'; $pupilFolder=$schoolName.$bar; # Create the pupil folder for later offline use $dirPath=$hotBase.'pupils/'.$pupilFolder; if (-e $dirPath){ print 'already made'; } else{ mkdir $dirPath,0777; print $dirPath; }