in reply to Re^4: Why 'Net::Address::IP::Local'->public do not return IP address
in thread Why 'Net::Address::IP::Local'->public do not return IP address

But that was what you wanted, wasn't it?

When you do this:

print "$@";
you ask your program to print the error during the creation of the socket, and that's what you get:
Unable to create UDP socket: A socket operation was attempted to an un +reachable network. at C:/Perl/site/lib/Net/Address/IP/Local.pm line 166.
If you don't want to get this warning printed, then just don't print it.

But now, your program does not die anymore because of this network exception, this is no longer a fatal error, since your subroutine is able to continue with the next line of code and to return the 192.80.160.16 IP address.

Or did I misunderstand what you were after?

Je suis Charlie.