in reply to please help - c shell in perl

Answering a different question to the one you asked...:-) If you want to get the 'names' of various hosts from their IP addresses, there is a standard UNIX library call you can use to do this, called 'gethostbyaddr'. Of course, perl allows you to access this, its listed in the 'perlfunc' part of the perl documentation. The docs for this are scary, and point you to the wrapper modules Net::hostent. The docs for these are friendly, and give us:
#!/usr/local/bin/perl -w use Net::hostent; my @ips = qw( 1.2.3.4 5.6.7.8 ); # Use your own IPs my %hosts; foreach my $ip ( @ips ) { my $info = gethost( $ip ); # Returns an object unless( $info ) { warn( "gethost failed for [$ip] : $! $?" ); next; } # ...access other interesting bits of $info if you want... $hosts{$ip} = $info->name(); # Just want the name } # Ta da. The %hosts hash now contains a set of ip => host mappings. foreach my $ip ( keys %hosts ) { print "The hostname of IP address [$ip] is [$hosts{$ip}]\n"; }
This doesn't necessarily use the DNS. It depends on how your system is set up (if you are on some types of UNIX you can look at your /etc/nsswitch.conf file to work out what your system will use).