Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've found Net::Ping can't recognize IP but DBI can:
I guess Net::Ping treat varaible as number not string , but DBI don't. is there a way to resolve it ? Thanks s$IP = "192.168.0.1 192.168.0.2 192.168.0.3"; for my $ip_addr (split /\s/, $IP){ my $p = Net::Ping->new(); if ($p->ping( $ip_addr )) { $my_state->{IP_stat} = 'UP'} #can't ping else{ $my_state->{IP_stat} = 'unreachable'; next; } $p->close(); my $dbh = DBI->connect("dbi:" . $db_type . ":" . $ip_addr . "/" . $ser +vice_name, $sysUser, $sysPass ); #can connect
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IP address can't recognize by Net::Ping
by Corion (Patriarch) on Nov 24, 2023 at 07:10 UTC | |
|
Re: IP address can't recognize by Net::Ping
by Marshall (Canon) on Nov 24, 2023 at 07:34 UTC | |
|
Re: IP address can't recognize by Net::Ping
by hippo (Archbishop) on Nov 24, 2023 at 10:14 UTC | |
|
Re: IP address can't recognize by Net::Ping
by Anonymous Monk on Nov 27, 2023 at 07:08 UTC | |
|
Re: IP address can't recognize by Net::Ping
by Anonymous Monk on Nov 24, 2023 at 10:54 UTC |