Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Module Maintainence 2, Electric Boogaloo

by BlueLines (Hermit)
on Mar 26, 2001 at 08:33 UTC ( [id://67106]=perlquestion: print w/replies, xml ) Need Help??

BlueLines has asked for the wisdom of the Perl Monks concerning the following question:


A long time ago, i posted this regarding what to do when bugs are found in long lost CPAN modules. I recieved lots of useful information, but unfortunately i never heard back from the author. The patch i wrote is now being used internally at my work with great success.

6 weeks later, i've run into the same problem with Sys::HostIP. I needed a good, portable way to obtain the ip addresses used on a given machine. Sys::HostIP does this well in a Win32 environment, but when used in the *NIX realm, bugs rear their ugly head:

  • Most stuff we do in my company has to be written to work without dns. Sys::HostIP depends on dns in *NIX based systems.
  • Some people break their /etc/resolv.conf by listing their primary hostname as an alias for Sys::HostIP would erroneously return this ip address.
  • There's nothing stopping me from setting my hostname to <cpan::Sys::HostIP> would return in this circumstance, even though that ip address doesn't exist on my system.
  • If I use a dial-up connection, and my ip address is set by my isp, that ip would not match up to whatever hostname i gave myself.

So because of this, I've written a module (tenatively named Sys::IP) which contains 3 functions:

  • One function returns a scalar containing the first ip address it finds that's not This is convienient for people who only use one interface and don't want to deal with an array or hash.
  • One function returns a list of all ip addresses used on a machine.
  • One function returns a hash reference to a hash with keys made up of all running interfaces on a machine, and whose values are the interface's ip addresses.

Currently this module works under linux, (Free||open)BSD, Irix, and Solaris. I haven't found any more machines to test this on, but I plan on adding as many OS's as possible. I'll be posting the code here within a few days (gotta write those comments).So here's the question:


  • Is it OK to take the Win32 code from Sys::HostIP to use in my module? The module itself states no license terms, and I haven't been able to get in contact with the author (his/her given email address bounces). Which leads me to
  • Should this be a seperate module from Sys::HostIP, or a patch for it? Since I can't get in touch with the author, what should i do?


Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.

Replies are listed 'Best First'.
(tye)Re: Module Maintainence 2, Electric Boogaloo
by tye (Sage) on Mar 26, 2001 at 23:51 UTC

    I vote for a patch to Sys::HostIP. I really dislike the idea of two similar modules sharing exactly the same chunk of code. But I also like the idea of giving Sys::HostIP a new active maintainer. (:

            - tye (but my friends call me "Tye")
Re: Module Maintainence 2, Electric Boogaloo
by darobin (Monk) on Mar 27, 2001 at 02:02 UTC

    I'd say contact the CPAN people and explain the problem, stating the fact that you have a working module that is a good replacement. Switching maintainers happens when there is no way to contact the author.

    Otherwise, as much as I dislike duplicated code, I'd go for the option of taking the code from Sys::HostIP and putting it into your own module directly. It happens all the time, and is a better solution for end-users than having to use two different modules while you wait for ownership transmission to happen. Plus, it's likely that over time you will come up with some changes to that part of the code, and a year down the line it might not even look anything like what you ripped^W^W^W^Wborrowed from HostIP.

    PS: have you tried a google search on the author's name ? It often yields some info...

    -- darobin

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://67106]
Approved by root
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-07-19 08:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.