This function changes the permissions of a list of files.
The first element of the list must be the numerical mode, as in
chmod
(2).
(When using nonliteral mode data, you may need to convert
an octal string
to a decimal number using the
oct
function.)
The function returns the number of files successfully changed.
For example:

$cnt = chmod 0755, 'file1', 'file2';

will set
$cnt
to
0
,
1
, or
2
, depending on how
many files got changed (in the sense that the operation succeeded, not
in the sense that the bits were different afterward). Here's a more
typical usage:

chmod 0755, @executables;

If you need to know which files didn't allow the change, use something like this: