use strict; use warnings; use Socket; my $Ifile = 'c:/Perl/RC/PC_List.txt'; # P R O C E S S I N G #---------------------# open IPF, "<$Ifile" or die "\n\tCan't open $Ifile :: $!\n"; while () { chomp; my @fields = split /\|/, $_; my $hostname = $fields[0]; print "\n\tProcessing PC $hostname\n"; if ( my $ipAddress = gethostbyname( $hostname ) ) { print "\n\tThe Ip address for $hostname is", inet_ntoa( $ipAddress ), "\n" ; } else { print "\n\tUnable to resolve IP address for $hostname\n" ; } } close IPF or die "\n\tCan't close $Ifile :: $!\n" ;