in reply to Getting net addy on localhost?

You've gotten lots of perl solutions, so let me offer a non-perl one. If you have GNU hostname on your machine1, use the -i option to get the machines IP address.
$ hostname -i 63.150.14.148
1 any flavor of linux or other machine with the standard set of GNU tools installed.

-Blake