Changeset 5e71d34 for fedkit/gateway_lib.pm
- Timestamp:
- Jan 18, 2013 10:06:54 AM (12 years ago)
- Branches:
- master
- Children:
- 8f654de
- Parents:
- 950b55e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/gateway_lib.pm
r950b55e r5e71d34 44 44 $t = new File::Temp() || die "Can't open tempfile: $!\n"; 45 45 46 # If the parameter is in the file (even in a comment) update the line to 47 # have the new parameter. 48 my %updated; 46 49 while (<$f>) { 47 50 foreach my $k (keys %{$keys}) { 48 s/^\s*#?\s*$k.*/$k $keys->{$k}/;51 if (s/^\s*#?\s*$k.*/$k $keys->{$k}/) { $updated{$k}++; } 49 52 } 50 53 print $t $_; 54 } 55 # Any parameters not found above are output directly. 56 foreach my $k (keys %{$keys}) { 57 print $t "$k " . $keys->{$k} . "\n" unless $updated{$k}; 51 58 } 52 59 $f->close();
Note: See TracChangeset
for help on using the changeset viewer.