[EMAIL PROTECTED] (via RT) wrote:
> #!/usr/local/bin/perl
> use warnings;
> use strict;
> my $n = 1;
> my @data =
>       ([ qw(a0 a1 a2 a3) ],
>        [ qw(b0 b1 b2 b3) ],
>        [ qw(c0 c1 c2 c3) ],
>       );
> use Data::Dumper;

There are no array slices in your examples. In a [] subscript,
expressions are evaluated in scalar context.

> # This gives no warning - presumably it's using the comma operator.
> print Dumper map { [ $_->[0, 1] ] } @data;

Yes, this gives the subscript 1. Not a bug.

> # Strangeness with .. operator
> print Dumper map { [ $_->[0 .. 1] ] } @data;

That's a flip-flop, not a range, due to scalar context.
It's consistent with this :

    $ perl -le 'print $a while $a = 0..1' | head
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

but I don't explain this behaviour, since 0 should be false.
Might be a bug.

> # This should be exactly equivalent to the previous statement...
> my @l = 0 .. 1;
> print Dumper map { [ $_->[EMAIL PROTECTED] ] } @data;

An array in scalar context gives length, so the subscript here is 2. Not
a bug.

Reply via email to