http://qs1969.pair.com?node_id=514972


in reply to using pipes in a system() call

Why don't you add a line before your system call...

print "find $home[$i]$dir -user $UID -print | xargs -n 1 chown -h $NEW +UID\n"; system("find $home[$i]$dir -user $UID -print | xargs -n 1 chown -h $NE +WUID");
Now you can see what it's expanding into with the variable interpolation. I'm guessing the variables aren't expanding into what you think they are.

Edit: Fletch's response to this node points out the dangerous situation that my suggestion can lead to. I'm leaving it in place as it's a valuable lesson to be learned.