Help for this page

Select Code to Download


  1. or download this
    $ perl -Mstrict -wcE 'my @x = map my $x = $_, 2; say $x'
    -e syntax OK
    $ perl -Mstrict -wcE 'my @x = map {my $x = $_} 2; say $x'
    Global symbol "$x" requires explicit package name at -e line 1.
    -e had compilation errors.
    
  2. or download this
    $ perl -Mstrict -wE 'my @x = map my $x = $_, 2; say $x'
    Use of uninitialized value $x in say at -e line 1.
    $ perl -Mstrict -wE 'my $x; my @x = map $x = $_, 2; say $x'
    2