while (<PASSWD>) { my @passwds = split /:/, <PASSWD>; }
Note that you've used <PASSWD> twice. This will skip the even-numbered lines of the file, not the odd-numbered. This is because you read a second line from the file each time inside the loop, splitting on that value. Therefore, your first line that is read from the file (read into $_ in the while() loop) is more or less being discarded.
In reply to Re: Understanding split in a while loop
by saskaqueer
in thread Understanding split in a while loop
by ghenry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |