Commit c2535ae3 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

OmegaUtils: deal with repeated keys

parent e3c46c01
......@@ -17,7 +17,23 @@ sub getLabels
chomp;
foreach my $key (keys %$hptr) {
if (/$key[= ]([^ ]+)/) {
${$hptr->{$key}} = $1;
my $newVal = $1;
my $prev = ${$hptr->{$key}};
if ($prev) {
print STDERR "Already a previous value for $key of $prev\n";
print "New value is $newVal\n";
print "To take new value press ENTER. Or enter value ";
$_ = <STDIN>;
chomp;
if ($_) {
${$hptr->{$key}} = $_;
print STDERR "$0: Value for $key is ".${$hptr->{$key}}."\n";
next;
}
}
${$hptr->{$key}} = $newVal;
print STDERR "$0: Value for $key is ".${$hptr->{$key}}."\n";
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment