How do I set permissions on directories and files from Perl?
From perl you want to set the permissions on a file or directory.
The solution
There is a perl function called chmod. It can be called on files or directories. You can use it as follows:
You can also use chmod on a list of files. Chmod returns the number of files that were modified, so you can tell if all the chmods were successful.
If two of the three files existed, the output of this program would be: