Also note that it's not using the first line, but the second one. That's because you read the first one into $_ in the while loop condition, and the rest to @arr in the while loop body (so the loop only iterated once). Usually, you don't use several <...> operators on the same file handle.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Comment on Re: traverse through passwd file, and split fields to extract UID/GID