Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi everyone i am trying to chmod a few files through my perl script, i want to know if there is a way to chmod a group of files (4 files to be exact), right now i am doing it as chmod (655, $File1); within my script, but seems like this is not working either.. can anyone help thank you

Replies are listed 'Best First'.
Re: chmoding files
by jdporter (Paladin) on May 19, 2003 at 15:09 UTC
    I'm kind of surprised it didn't occur to you to read the documentation for the chmod function. It would have answered both your questions.

    1. You can supply any number of files in the list, not just one.
    2. The mode number is not assumed by perl to be octal. If you want to represent the value in octal, you have to write it properly. That means giving a leading zero.
      chmod 0655, $file1, $file2, @other_files, get_more_files();

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.