Harry Putnam wrote:
[EMAIL PROTECTED] writes:


Hi,
  I'm trying to find my IP address from within Perl for eth0 and ppp0.
Currently I run a regex on the output of ifconfig to extract his data -
but, I'd like to do this from within Perl and it strikes me that this
should be possible.

HELP! ANYBODY!


Well this module seems to do what you want already:


http://search.cpan.org/~bluelines/Sys-HostIP-1.3.1/HostIP.pm

I would say have a go at using it, or if you really want to re-invent
the wheel (maybe for a different kind of vehicle) have a look at the

source.


http://danconia.org

This only tells me my eth0 IP address (192.168.0.10) which is my internal LAN IP address - which is not so useful, since I assigned this address! I'm trying to find out what my Internet or ppp0 IP address is. There must be an easy way of doing this.

Any ideas


One surefire way is to use the dialog when your web browser hits a
page like: http://www.jtan.com/~reader/my_tricky_remote_addr.cgi.  It
generates a page displaying your IP as seen by the http page server.

This Source code produces what you see at above url.

<snip>



One nice aspect of doing it this way is that you could view that machines IP from anywhere by making the cgi write its output to file.

Hit the cgi from test machine then hit the generated webpage from
another address, you should see the test machines address displayed.

<snip>

Unless you are proxied.....

http://danconia.org


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to