ribasushi has asked for the wisdom of the Perl Monks concerning the following question:
It gives meuse strict; use warnings; use Parse::RecDescent; use Data::Dumper; $::RD_AUTOACTION = q { [@item] }; my $parse = Parse::RecDescent->new (q { config: section(s) /\z/ section: server | key server: 'bind-server' ip { [@item[0,2]] } ip: ascii_byte '.' ascii_byte '.' ascii_byte '.' ascii_byte { join + ('', @item[1..7]) } ascii_byte: /\d+/ <reject: do{$item[1] > 255}> { $item[1] } key: 'tsig-key' filename { [@item[0,2]] } filename: '"' /[^"]+/ '"' { $item[2] } | /[^"\s]+/ { $item[1] } }); print Dumper $parse->section (' bind-server 127.0.0.1 tsig-key "/etc/bind/rndc.key" ');
like the second parsed line does not exist.$VAR1 = [ 'section', [ 'server', '127.0.0.1' ] ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse::RecDescent trouble
by davorg (Chancellor) on Jan 12, 2007 at 12:33 UTC | |
by ribasushi (Pilgrim) on Jan 12, 2007 at 12:52 UTC | |
|
Re: Parse::RecDescent trouble
by ikegami (Patriarch) on Jan 12, 2007 at 18:01 UTC | |
by ribasushi (Pilgrim) on Jan 12, 2007 at 21:32 UTC | |
by ikegami (Patriarch) on Jan 12, 2007 at 22:26 UTC | |
|
Re: Parse::RecDescent trouble
by ferreira (Chaplain) on Jan 12, 2007 at 12:26 UTC | |
by ribasushi (Pilgrim) on Jan 12, 2007 at 12:30 UTC |