in reply to printing passwd file

perl -lne 'print (split(/:/))[0]' /etc/passwd should be typed as-is on the shell command line. The script version of it would be:

open(PASSWD, '/etc/passwd/') or die("Can't open the system password file: $!\n"); print((split(/:/))[0], "\n") while (<PASSWD>); close(PASSWD);