error is :use strict; use warnings; use Net::Address::IP::Local; print ReturnIpAddress(); sub ReturnIpAddress { my $address; select STDOUT; eval{ $address = 'Net::Address::IP::Local'->public ; ## Rece +iving the current IP ## }; if ($@) { print "$@"; return '192.80.160.16'; ##If No IP address received th +en return a static IP of order "192....." } else { return $address; } }
Unable to create UDP socket: A socket operation was attempted to an un +reachab network. at C:/Perl/site/lib/Net/Address/IP/Local.pm line 166.
In reply to Re^2: How to handle Net::Address::IP::Local'->public when we are not connected to internet (INADDR_ANY)
by Anonymous Monk
in thread How to handle Net::Address::IP::Local'->public when we are not connected to internet
by ppp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |