in reply to using pipes in a system() call

When debugging problems like this, I usually form the string that will go to system, then print it. This helps me find bad interpolations, etc.

On a side note, you can chown in Perl. Combining it with File::Find could make this tool pure Perl, reducing all sorts of possible problems.

Phil