#!/usr/bin/perl # get host by name exploration # get me is the test hostname I set up to try this out it has 35 addresses assigned to it. ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname "getme.patch.com"; # print "$name $aliases $addrtype $length\n"; foreach (@addrs) { ($a,$b,$c,$d) = unpack("C4",$_); print "$a.$b.$c.$d\n"; } # yep, most of the above is cut and paste from perlfunc manpage