$ perl -wle'my %h = map { $_ => 1 if $_ > 5; } 1..3; print 0+keys(%h);' Odd number of elements in hash assignment at -e line 1. 1