I need help with this program. As a part of my project I need to create a directory. I was using the system function to do this, but later was told that Perl has a builtin called mkdir.
I'm on Ubuntu 10.04. The problem is mkdir
does not seem to work as needed.
It creates the directory but the permissions are different. Here is my function that creates the directory:
sub createDir {
my ($dir,$perm) = @_;
unless(-d $dir) {
mkdir $dir,$perm or die "$!";
}
}
and I call it in many parts of my program as:
createDir('.today','0755');
the directory .today gets created but the problem is with permissions, it does not have the 0755 permission.
What am I doing wrong?
My Perl details are:
$perl -v This is perl, v5.8.8 built for x86_64-linux-thread-multi