You probably want to take a look at
Nmap::Scanner, which is a nice way to integrate nmap with Perl. Using nmap is an advantage because it has already been optimized for scanning large numbers of hosts quickly and accurately. Just have it do a TCP connect() scan (which doesn't require any special privileges) on port 23 for all your hosts, then try to telnet on the ones that are successful. Not all nmap scans require root access, they just might not be as efficient or sneaky without it.