Hi Everyone,
My project is simple - you need to take this piece of perl code:
my $command = "cd ".$homeDir.";
find -type d -exec chmod 755 {} \;
find -type f -exec chmod 644 {} \;
find -iname \"*.pl\" -exec chmod 755 {} \;
find -iname \"*.cgi\" -exec chmod 755 {} \;
chown `pwd|cut -d/ -f3`.`pwd|cut -d/ -f3` * -R";
# Execute the commands
system($command);
and convert it into pure Perl, not using the exec(), system() or backtick operators.
Basically, this code will go into a perl class package file, and I would like to call it as:
$self->fixPermissions('/home/username/',username,groupname);
And it would then go through and update all files to 644 permissions, 755 for all directories, 755 for any .pl and .cgi scripts and chown both user and group to the specified user in the function call.
Cheers,
Craig
Hi, I can handle this task. I have over 2 years of experience with Perl and it is still a useful scripting language for my day job. Kindly contact me if you’re intersted. Thank you.