I am new to Perl development and I wanted to check if using conditional operators inside a push statement is allowed. Something like this
push(@myMap, {
key1 => value1,
key2 => value2,
(condition)?{
key3 => value3,
}:(),
key4 => value4
});
Basically I only want to add a value to a Map based on a condition