<p>This fails:</p>

<pre><code>my @a = ("a", "b", "c", "d", "e");
my %h = map { "prefix-$_" =&gt; 1 } @a;
</code></pre>

<p>with this error:</p>

<pre><code>Not enough arguments for map at foo.pl line 4, near "} @a"
</code></pre>

<p>but this works:</p>

<pre><code>my @a = ("a", "b", "c", "d", "e");
my %h = map { "prefix-" . $_ =&gt; 1 } @a;
</code></pre>

<p>why?</p>

Because Perl is guessing an EXPR (a hash reference, for example) instead of a BLOCK. This should work (note the '+' symbol):
```
```
my @a = ("a", "b", "c", "d", "e");
my %h = map { +"prefix-$_" => 1 } @a;
```
```
See
http://perldoc.perl.org/functions/map.html
.