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

Is it possible to use the chmod function to recursivly change the permisions on some directorys? Using a shell you would pass the -R option, but how is this done in a perl script? Any sample code? thanks

Replies are listed 'Best First'.
RE: help with the chmod function
by vroom (His Eminence) on Jan 07, 2000 at 02:39 UTC
    You could use a system call to do it from within your script. system "chmod -R $directory"; Otherwise if you really wanted or needed to use Perl's chmod function it takes a list of files so you could either use File::Find to construct a list beforehand or use File::Find and chmod on each of the files individually. Your easiest solution would be a system calll. If you really want to do it the other way you may want to reference How do I recursively process files through directories