I need help with this program. As part of my project, I need to create a directory. I used the system function for this, but it was later said that Perl has a built-in call to mkdir .
I'm on Ubuntu 10.04. The mkdir problem does not seem to work as needed.
Creates a directory, but 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 follows:
createDir('.today','0755');
the .today directory is created, but the problem is related to permissions, it does not have permission 0755 .
What am I doing wrong?
Details of my Perl:
$ perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
source share