Problem with Perceus dhcpd import script

After a couple days of banging my head against the wall trying to figure out why the import script kept giving this cryptic error, we finally submitted a question to the Perceus mailing list.

Undefined subroutine &main::add_node called at ./import-isc-dhcpd.pl line 46,  line 8.

I’m sure if I knew Perl that error wouldn’t have been so confusing.

Here’s a diff for anyone who’s interested.

43c43
<    if ( $_ =~ /^s*hosts+([^s]+)s*{s*$/ ) {
---
>    if ( $_ =~ /^s*hosts+([^s]+)s*{?s*$/ ) {
46c46,47
<       &add_node($1, $hostname);
---
> print "Adding: $1, $hostnamen";
>       &node_add($1, $hostname);
51a53
>

Leave a Reply

Your email address will not be published. Required fields are marked *