Hum ... do you want to call the system command "
mkdir" ? or use the Perl function "
mkdir()" ? your example seems to mix the call to the mkdir system command with the use of the mkdir function ...
If you want to call the system command
/bin/mkdir with
system() :
system( "mkdir", $NEW_AGENDA_ROOT ) == 0 or die( "Failed to create dir
+ectory $NEW_AGENDA_ROOT." );
(see "
perldoc -f system" for explanation on this construction)
If you want to use the
mkdir() function then :
mkdir($NEW_AGENDA_ROOT, 0777) or die( "Failed to create directory $NEW
+_AGENDA_ROOT: $!" );
(see "
perldoc -f mkdir" for the mkdir function help)
By the way, you should use this mkdir() Perl function. It's the prefered way to make a directory from perl, as it's a builtin function available on all platform, and is much more secure than the use of a system call.
update: Removed the final "0777" argument on the system() call for the mkdir command as it won't set the access mode but simply create the directory "
0777". (If you wants to set the access rights you can use the mkdir "
--mode " switch). Thank you
grantm for pointing me on this error.