After a quick look at your code: how about removing comments before processing?
I think that's a must because you do allow comments (in your examples), but then you do when ( /interface/ ) { which will match a commented-out interface line or anything really that mentions the word "interface".
What I usually do for removing comment lines is $line =~ s/#.*$//; next if $line =~ /^\s*$/;
Secondly, if your grammar will grow then you are better off using other solutions, which other Monks I am sure will mention.
bw, bliako
In reply to Re: Yet another config file editing programme : Tell me how to make it better !
by bliako
in thread Yet another config file editing programme : Tell me how to make it better !
by dazz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |