#!/usr/bin/perl open(USERDOMAINS,"/etc/userdomains"); while(<USERDOMAINS>) { if (/^$ARGV[0]: (\S+)/i) { print $1; } } close(USERDOMAINS); print "\n";