On Mon, Dec 17, 2001 at 05:04:28PM +0100, Eelco Alosery wrote: > what is wrong whit thee's lines, if i run this, perl make's a directory > testdir but it olso makes a file testdir/test.file. > perl dus not make the file in the directory testdir. > > on the internet under unix it works fine but on my mac it make's a mistake > > > > $dir = "testdir"; > > if (!-e "$dir") { > mkdir "$dir", 0755; > chmod 0777, "$dir"; > } > > if (!-e "$dir/test.file") { > open(MAKE,">$dir/test.file"); > chmod 0766, "$dir/test.file"; > close(MAKE); > } >
On a Mac, the path separator is : rather than /. You can use File::Spec to deal with file paths in a cross-platform compatible way. Ronald