Make sure you don't handle files and directories as strings and simply concatenate them with a slash in between. Perl:
$path = File::Spec->catfile("dir1", "dir2", "file")
Remember that Windows has volumes:
($volume, $path, $file) = File::Spec->splitpath($full_path);
@directories = File::Spec->splitdir($path);
When running other programs, try to avoid involving the shell. In Perl, when you run a command with the system
function, you can easily get it wrong with:
$full_command = 'C:\Documents and Settings/program.exe "arg1" arg2'; # spaces alert!
system($full_command);
Instead, you can run system with a list as argument: the executable and the arguments being separate strings. In that case, the shell doesn't get involved and you don't get into trouble regarding shell escaping or spaces in file names.
system('C:\Documents and Settings/program.exe', 'arg1', 'arg2');
There's a bunch of portability nits documented in the perlport manual.