Saturday, April 11, 2009

Problems with Net::DHCP::Watch on mac...solved

So I got this running, I was having some problems using it.
I had this error:

Can not resolve: at line 8
Can't call method "addr_list" on an undefined value at /Library/Perl/5.8.8/Net/DHCP/ line 57.

I think it has something to do with the way it was parsing the IP's in both the $Server and $IP, so I solved it by adding these lines to the /etc/hosts...which you will need to sudo for, so sudo vi /etc/hosts, and append: dhcp.local me.local

That is assuming that your IP is and your dhcp server is So just make it look like this in your perl file:

my $Server = "dhcp.local";
# this machine ip and ethernet address
my $IP = "me.local";

I really don't know what the problem was so this is kind of a cluge.

No comments: