Does anyone know of a way to programmatically obtain my local IP address without
having to parse it out. The only way I know how is to redirect the output from ifconfig to some sort of program and parse the IP out. Not only does this seem harder than it has to be, it seems to be a bit hackish. (I would prefer to use perl or bash scripting)
Speaking of hackish:
In case you're wondering why I need it is because i'm trying to use my computer as a server. I'm too broke to afford a static IP, so I'm going to use my ISP web account as the "static ip" and automatically redirect the page to my current IP address. Everytime I turn my computer on (or my IP changes), I will run a cgi script on my "static ip" web page which will store the new address and be able to redirect visitors to my local computer. I will have this script run automatically so I need to be able to programmtically get my IP.
(Sorry if this thread is in the wrong place)