in reply to using chown to change file ownership

perldoc -f chown

from which...

chown LIST Changes the owner (and group) of a list of files. The +first two elements of the list must be the numeric uid and gi +d, in that order. A value of -1 in either position is interp +reted by most systems to leave that value unchanged. Returns th +e number of files successfully changed. $cnt = chown $uid, $gid, 'foo', 'bar'; chown $uid, $gid, @filenames;

You might even be served well to read the whole thing.