That's the point, you are not calling the Perl mkdir command, you are spawning a child process to run an external program called mkdir. The error is comming from the external program, not from perl.
Comment on Re^3: problem in checking if directory exists