Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (14 sloc) 0.43 kb
#! nqp
# check positional subscripting
plan(7);
my @l := (1,2,3,4,5);
say("ok 1 # list assignment didn't barf");
say('ok ',@l[1], ' # numeric subscript');
say('ok ', @l['2'], ' # string subscript');
my $idx := 3;
say('ok ', @l[$idx], ' # variable subscript');
say('ok ', @l[$idx + 1], ' # expression in subscript');
@l[0] := 'ok 6 # string array element';
say(@l[0]);
@l[10] := 'ok 7 # automatic expansion';
say(@l[10]);
Jump to Line
Something went wrong with that request. Please try again.