that will remove any newline characters from the string if they exist.
i'm not sure what your "next if !$user" line is doing. since you're already inside a while loop, that logic should already be taken care of without having to check the $user variable again.