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)
[download]
which inserts either zero or two elements into the list of key-value pairs, depending on the condition.
Dave.
Comment on
Re: Initializing a hash using conditions
Download
Code
In Section
Seekers of Perl Wisdom