Not quite - when you do a gethostbyaddr, it returns a few different things... from perldoc:
($name,$aliases,$addrtype,$length,@addrs) = gethost*
if I gethostbyname, however, it populates $aliases with the same name you specified in the initial call to gethostbyname...
No freaking way it compiled on the first try...