in reply to Yet another config file editing programme : Tell me how to make it better !
G'day Dazz,
"Readability and maintainability are more important to me that speed or brevity."
That's great. Here's some suggestions:
use constant { TRUE => 1, FALSE => 0, };
$ perl -E 'my $x = "whateverstaticip_address=X"; say $x =~ /^.*static\ +s*ip_address=/ ? "YES" : "NO"' YES $ perl -E 'my $x = "whateverstaticip_address=X"; say $x =~ /^\s+static +\sip_address=/ ? "YES" : "NO"' NO
There's quite a few points. There may be others that I didn't pick up on my first pass through your code.
— Ken
|
|---|