Commit 3134ed8c authored by Clément OUDOT's avatar Clément OUDOT
Browse files

Fix for addKey and manage delKey (#1494)

parent c8ce3344
......@@ -107,8 +107,8 @@ sub addKey {
$el->[2];
}
elsif ( $#path == 3 ) {
$new->{ $path[0] }->{ $path[1] }->{ $path[2] }
->{ $path[3] }{ $el->[1] } = $el->[2];
$new->{ $path[0] }->{ $path[1] }->{ $path[2] }->{ $path[3] }
->{ $el->[1] } = $el->[2];
}
else {
die $el->[0] . " has too many levels. Aborting";
......@@ -142,6 +142,13 @@ sub delKey {
elsif ( $#path == 1 ) {
delete $new->{ $path[0] }->{ $path[1] }->{ $el->[1] };
}
elsif ( $#path == 2 ) {
delete $new->{ $path[0] }->{ $path[1] }->{ $path[2] }->{ $el->[1] };
}
elsif ( $#path == 3 ) {
delete $new->{ $path[0] }->{ $path[1] }->{ $path[2] }->{ $path[3] }
->{ $el->[1] };
}
else {
die $el->[0] . " has too many levels. Aborting";
}
......
Supports Markdown
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