in reply to IP address can't recognize by Net::Ping

Well done for providing some code to illustrate the problem. Unfortunately what your code demonstrates is merely that the target addresses are not responding to the Net::Ping tests, it passes no judgement on whether or not the addresses are "recognized".

use strict; use warnings; use Test::More tests => 7; use Net::Ping; my $p = Net::Ping->new; for my $host (qw/www.perlmonks.org tcpbin.com/) { ok $p->ping ($host), "$host pinged"; } for my $host (qw/www.ibm.com www.whitehouse.gov/) { ok !$p->ping ($host), "$host blocks pings"; } for my $host (qw/lsdfskf wocka.wocka 192.168.1/) { ok !$p->ping ($host), "$host doesn't respond because it won't reso +lve"; }

Note how the second and third sets behave the same in terms of the false return value from the ping method despite failing in different ways.


🦛