For a project I was messing around with in my spare time, I tried whipping up something sort of like Netcraft, but optimized to pull up the sort of information I look at when I want to know something specific about the host.
Anyway, one thing I tried to have it do was shell "whois $ip" (where $ip is the IP address of the host -- this isn't entered directly, so I don't need to worry about people passing "bad" arguments ot it)... I tried like 50 different iterations of something like the following:
system("whois $ip", $whois-ip);
That technically "works," but the problem is that it's all one big mess of text -- indentation, newlines, etc. are taken out?! I've tried anything I could think of, but I cannot possibly find a way to make it preserve them.