$address='Net::Address::IP::Local'->public ; #### Unable to create UDP socket: A socket operation was attempted to an unreachable network. at C:/Perl/site/lib/Net/Address/IP/Local.pm line 166. #### sub ReturnIpAddress { if( 'Net::Address::IP::Local'->public =~ m/^(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)$/ ) { return $address= 'Net::Address::IP::Local'->public; #When i try to print this address it print nothing s it crashes because of the error due to the enteres command i discussed before. } else { return $address='192.80.160.16'; } }