- or download this
@a = ('a' .. 'i'); # 9 lower case letters
print "Before: @a\n"; # prints: a b c d e f g h i
...
print "After: @a\n"; # prints: a b c X Y Z f g h i
print "Pulled out: @x\n"; # prints: d e
- or download this
@x = splice @a, 3, 2, 'X', 'Y', 'Z';
- or download this
@x = splice @a, 3, 2;
- or download this
@x = splice @a, 3;
- or download this
@x = splice @a, 3, -2;
- or download this
Before: a b c d e f g h i
After: a b c h i
Pulled out: d e f g
- or download this
@x = splice @a, 3, -2, @r;
- or download this
@x = splice @a, -5, -1, @r;
- or download this
@x = @a[2..5];
- or download this
@x = @a[2, 3, 4, 5];
- or download this
@x = ($a[2], $a[3], $a[4], $a[5]);