It seems a run-time scope is created for map EXPR,.$ perl -wle'use strict; map +(my $x = $_), 2; print $x' Use of uninitialized value in print at -e line 1.
Incorrect. What is happening is the same thing that happens when you do that with a foreach statement modifier:
$ perl -wle'use strict; my $x = $_ for 2; print $x' Use of uninitialized value $x in print at -e line 1.
Braces or file boundaries are the only things that can create scope.
In reply to Re^3: syntax of map operator
by jwkrahn
in thread syntax of map operator
by sman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |