On Wednesday 28 May 2008 23:20:15 Patrick R. Michaud wrote:

> In particular, I think that the following sequence should
> result in a 0-length array:
>
>     my @array;
>     @array[8] = 'eight';            # array has elements 0..8
>     @array.delete(8);               # now it's empty again
>     say [EMAIL PROTECTED];                    # "0\n"
>
> Pugs (evalbot) disagrees with me on this:
>
>     06:16 <pmichaud> pugs:  my @array; @array[8]='eight'; @array.delete(8);
> say [EMAIL PROTECTED]; 06:16 <exp_evalbot> OUTPUT[8␤]
>
> Perl 5 agrees with my interpretation, though:
>
>     $ cat x
>       my @array;
>       $array[8] = 'eight';
>       delete $array[8];
>       print [EMAIL PROTECTED], "\n";
>     $ perl x
>     0
>     $
>
> Comments?

S29 suggests that this should be the case:

        Deleted elements at the end of an Array shorten the length of the Array,
        unless doing so would violate an is shape() definition.

http://perlcabal.org/syn/S29.html#Array

-- c

Reply via email to