in reply to creating directories

This doesn't make any sense:
$dir_name = "mkdir c:/testdir"; system($dir_name); # versus system("mkdir c:/testdir");
These should behave exactly the same way. Since that does not appear to be the case, I'm wondering if there's something else going on that you aren't telling us. Variable interpolation? Trailing newlines?

mkdir does not require a second argument (at least in 5.6; I don't know about earlier versions). As the documentation under 5.6 says, if omitted, it defaults to 0777. The documentation on the site seems to imply that it is required, so perhaps that's your entire problem if you're using an earlier version of Perl.

Otherwise, are you paraphrasing code here, or is this the actual live code you are using? Something else must be going on that we aren't seeing.