Help for this page

Select Code to Download


  1. or download this
    my @x = 0 .. 9;
    print "@x[2..4]\n";
    ...
    print "@x[@y]\n";
    @x[7..9] = @y;
    print "@x\n";
    
  2. or download this
    sub foo {
        wantarray ? 3 : 5;
    ...
    @x[2] = foo();
    my $x = foo();
    print "$x[2] <-> $x\n";