in reply to traverse through passwd file, and split fields to extract UID/GID

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
  • Download Code

Replies are listed 'Best First'.
Re^2: traverse through passwd file, and split fields to extract UID/GID
by intoperl (Acolyte) on Apr 23, 2014 at 13:17 UTC
    Thank you sir, i made a note of it. :)