in reply to Initializing a hash using conditions

if is a statement modifier, so you can't use it there. Try something like:
$i ? () : ('abc' => 7)
which inserts either zero or two elements into the list of key-value pairs, depending on the condition.

Dave.