Look at http://perl.linuxempire.net/save_perm, and http://perl.linuxempire.net/restore_perm, those are two scripts I used to fix a recursive 'chmod 000 *' on a development websevrer I have. :( save_perm has a very nice recursive subroutine, it's not leaky with global vars, it calls itself and returns to itself. Written with the help of 4 cans of mountain dew. :)