in reply to editing options in a file
my %config = ( CONFIG_PCI => 'y', CONFIG_BSD_PROCESS_ACCT => 'y', ); while (<>) { if ((my ($n,v) = split/=/) == 2) { if (my $new_value = $config{$n}) { print "$n=$new_value\n"; next; } } print; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: editing options in a file
by dsheroh (Monsignor) on Jun 21, 2006 at 15:41 UTC |