Die Vermutung ist wohl eher, dass das hier das Problem ist (fett markiert):
Aus perldoc -f gethostbyname
Quote These routines are the same as their counterparts in the system C library. In list context, the return values from the various get
routines are as follows:
($name,$passwd,$uid,$gid,
$quota,$comment,$gcos,$dir,$shell,$expire) = getpw*
($name,$passwd,$gid,$members) = getgr*
($name,$aliases,$addrtype,$length,@addrs) = gethost*
($name,$aliases,$addrtype,$net) = getnet*
($name,$aliases,$proto) = getproto*
($name,$aliases,$port,$proto) = getserv*
(If the entry doesn't exist you get an empty list.)
Somit wird dein
$name_of_this_machine undef und du bekommst die Warnung.