in reply to Re: Finding your IP address with Perl (Sys::HostIP)
in thread Finding your IP address with Perl

This module is actually doing what I was reluctant to do which was matching the IP address from `ipconfig` or the /etc/hosts file (depending on the OS) if it doesn't find the IP address based on what Sys::Hostname finds (which is incorrect).

Oh well, it works.
  • Comment on Re: Re: Finding your IP address with Perl (Sys::HostIP)

Replies are listed 'Best First'.
Re: (3) Finding your IP address with Perl (post to Snippets?)
by ybiC (Prior) on Dec 04, 2000 at 23:08 UTC
    I'm glad it works, also curious - why the reluctance?

    BTW, your script sounds like a good candidate for Snippets.   Dunno 'bout other monks, but I'd benefit from seeing it.
        cheers,
        Don
        striving for Perl Adept
        (it's pronounced "why-bick")

      The reluctance is because I don't like relying on regex matches against running other programs. It's often hard to predict errors, or inconsistencies. Besides that, it just seems "kludgy" and I thought there might be a better way to do it.

      The script is actually for updating DHS.org with your dynamic IP address. You can download my first shot at it here. It works fine in cron or MS scheduler. I'll post the relevent portions on the snippets site.