- or download this
my @a = (1,2,3,4,5);
(undef, my @b) = (@a);
print "@b\n";
#prints: 2 3 4 5 (the 1 is gone)
- or download this
my @a = (1,2,3,4,5);
my @b = @a[0,2..4];
print "@b\n";
#prints: 1 3 4 5
- or download this
my $text = "1 2 3 4 5 6";
my @tokens = split(/\s+/,$text,2);
...
#prints:
1
2 3 4 5 6