From 'perldoc -f umask':
"permission (or "mode") values you pass mkdir or sysopen are modified by your umask, so even if you tell sysopen to create a file with permissions 0777, if your umask is 0022 then the file will actually be created with permissions 0755"
So, unless mkpath() does some trickery with umask() by itself, the mode that you pass to mkpath() will be affected by current value of umask().
And make sure you prepend the mode with '0', as
Improv++ already mentioned.
--perlplexer