Subject: | Parse error when open/close braces are on the same line. |
Hi,
Very basic perl script that loads and then generates a config file:
#!/usr/bin/perl
use Net::ISC::DHCPd::Config;
use Data::Dumper;
my $config = Net::ISC::DHCPd::Config->new(file => '/root/dhcpd.conf');
printf "Parsed %s lines\n\n", $config->parse;
print $config->generate();
If I load the following file:
group {
next-server 192.168.0.2;
host box1 {
option host-name "box1"; hardware
ethernet 11:22:33:44:55:66; fixed-address 192.168.0.1;
}
host box2 {
option host-name "box2"; hardware
ethernet 66:55:44:33:22:11; fixed-address 192.168.0.2;
}
}
group {
next-server 192.168.0.2;
host box1 {option host-name "box1"; hardware ethernet
11:22:33:44:55:66; fixed-address 192.168.0.1;}
host box2 {option host-name "box2"; hardware ethernet
66:55:44:33:22:11; fixed-address 192.168.0.2;}
}
Which contains to functionally identical groups I get the following
output:
Parsed 16 lines, and got these objects:
group {
next-server 192.168.0.2;
host box1 {
option host-name "box1"; hardware ethernet
11:22:33:44:55:66; fixed-address 192.168.0.1;
}
host box2 {
option host-name "box2"; hardware ethernet 66:55:44:33:22:11;
fixed-address 192.168.0.2;
}
}
group {
next-server 192.168.0.2;
host box1 {
host box2 {option host-name "box2"; hardware ethernet
66:55:44:33:22:11; fixed-address 192.168.0.2;
}
}
As you can see, in the second group the box1 host is missing all its
options and wants to encompass the box2 host.
This is with the latest version and Perl version v5.16.1 on a Gentoo
machine.
Thanks,
Alex