in reply to gethostbyname one-liner: Improvements?

The one you have can be made shorter just by taking out some things that aren't really needed.

print"THR:\n",join('.',unpack'C4',(gethostbyname$host)[4]),$/;

This also loses a couple of characters by using $/ instead of "\n".

I've tried a few things, but I haven't gotten anything shorter than that. Maybe these will give you some idea I haven't had myself.

print "KYL:\n",join('.',map ord,split//,(gethostbyname$host)[4]),"\n"; $_=(gethostbyname$host)[4];s/./ord($&).'.'/ge;chop;print "KYL:\n$_\n"; use Socket;print "KYL:\n",inet_ntoa((gethostbyname$host)[4]),"\n"; printf"KYL:\n%d.%d.%d.%d\n",map ord,split//,(gethostbyname$host)[4];

Why do you need this, BTW?