in reply to password file problem

The code tags are helpful. You can (and should) also put them around output, so that your square brackets don't get misinterpreted by PerlMonks (as they have been, here).

You cannot put the "-lne" down in the body of the program. Those are command-line options. Your program would probably work if you typed at a command line: perl -lne 'print( (split(/:/))[0] )' /etc/passwd The extra set of parentheses are necessary.


Caution: Contents may have been coded under pressure.