in reply to Re^2: Reading IP from a file and SNMP
in thread Reading IP from a file and SNMP

Well it depends on how they are stored in the file. If there is only one IP per line, this code will do:
my @ip_array = (); if(open(F_IP,"<$filename")) { my %ip_hash = (); foreach my $ip (<F_IP>) { chomp($ip); #No duplicates! $ip_hash{$ip} = 1; } close(F_IP); @ip_array = keys(%ip_hash); } else { die "AHHHHH! Error Error go away!!"; } #Just keep doing your thing man...


Note that I wrote this on the fly and have not tested it. It should give you a good start though. =)

--habit