- or download this
@data[ @ordered[ 0, -1 ] ] = @data[ @ordered[ -1, 0 ] ];
- or download this
@data.setSlice(
items_to_set => [ @ordered.getSlice( 0, @ordered.last ) ],
values_to_set => [ @data.getSlice( @ordered.getSlice( @ordered.las
+t, 0 ) ],
);
- or download this
## an empty slice at runtime
c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ grep $_ == 10, 1.
+.9 ];"
## no output and no errors
- or download this
## an empty slice at compile time
c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ ];"
Scalar value @a[ ] better written as $a[ ] at -e line 1.
syntax error at -e line 1, near "[ ]"
Execution of -e aborted due to compilation errors.
- or download this
## a slice of one element at runtime
c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ grep $_ == 5, 1..
+9 ];"
f
- or download this
## a slice of one element at compile time
c:\test>perl -mstrict -wle"my @a='a'..'z'; print @a[ 5 ];"
Scalar value @a[ 5 ] better written as $a[ 5 ] at -e line 1.
f