in reply to Changing UIDs

You're programming like a crazy man, with code going everywhere! Maybe if you pull out some of the extraneous material and things will start to make sense:
while(<PWD>) { my($name,$passwd,$uid,$gid,$gcos,$dir,$shell)=split /:/; $uid=$UIDS{$name} if (defined $UIDS{$name}); $line=join ':',$name,$passwd,$uid,$gid,$gcos,$dir,$shell; print TMP $line; }
Also, why use 'uname' when 'hostname' is a much better tool for finding your hostname. Not to mention the Sys::Hostname module which does an even better job.