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'; } }