in reply to Re: How to handle Net::Address::IP::Local'->public when we are not connected to internet (INADDR_ANY)
in thread How to handle Net::Address::IP::Local'->public when we are not connected to internet
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to handle Net::Address::IP::Local'->public when we are not connected to internet (INADDR_ANY)
by Laurent_R (Canon) on Jan 19, 2015 at 18:54 UTC |