When you do this:
you ask your program to print the error during the creation of the socket, and that's what you get:print "$@";
If you don't want to get this warning printed, then just don't print it.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.
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?
In reply to Re^5: Why 'Net::Address::IP::Local'->public do not return IP address
by Laurent_R
in thread Why 'Net::Address::IP::Local'->public do not return IP address
by ppp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |