Perl : ping for multiple IPs not working

view story

http://www.unix.com – I have written perl ping program to ping list of IPs one by one and print the status.But each and every time it is showing the status as Pass for all IPs even though the IP is wrong. multipleip.pl Code:     use Net::Ping;     $p = Net::Ping->new();        $ifile="inventory.txt";     open(IP,$ifile) or die("Not able to open the file");     @data_count=(<IP>);     for($i=0;$i<=$#data_count;$i++)     {     my $host=$data_count[i];     if ($p->ping($host)) (HowTos)