#!/usr/bin/perl # This was an question from a Google face-to-face interview. # Look for all userids with a given letter/pattern in it. # getpwent returns /etc/passwd + NIS and/or LDAP entries while (($name)=getpwent()) { print "$name\n" if ($name =~ /$ARGV[0]/) }