BTW, Perl has a chmod() function that does the same thing as the chmod command. It doesn't have the nifty features, like recursion or symbolic modes, but you aren't using those. It is simpler to call the the function when you can use it. Also, it makes checking for errors easier.