in reply to Re^2: syntax of map operator
in thread syntax of map operator
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: syntax of map operator
by ikegami (Patriarch) on Jan 24, 2010 at 18:49 UTC | |
by jwkrahn (Abbot) on Jan 24, 2010 at 20:10 UTC | |
by ikegami (Patriarch) on Jan 24, 2010 at 21:56 UTC | |
by jwkrahn (Abbot) on Jan 25, 2010 at 02:36 UTC | |
by ikegami (Patriarch) on Jan 25, 2010 at 02:50 UTC |