in reply to constant issue
chmod's first argument is a number, which most of the time is written in source code as an octal number (like 0620). But this is a convenience for the reader of the code, since octal numbers are much easy to interpret as Unix permission modes (which are split in groups of 3 bits).
However, for Perl, this
works the same aschmod 400, @files
chmod 0620, @files
So I recommend you use your constants just like you did and when you want to take a look at its value use
sprintf "0%o", B_OGUS # returns "0620"
Also be sure to read the note in chmod documentation about this argument as a number and not as a string to avoid another common mistake.
|
|---|