$ret[$first_pos..$last_pos] = ( ( ("1") x ($last_pos - $first_pos + 1) ) );
1 2 3 4 5 6 7 8
my @array = (0)x10; my $first = 2; my $last = 5; # Array Slice; beachte das @ am Anfang! @array[$first..$last] = (1) x ( $last - $first +1 ); print "@array";
0 0 1 1 1 1 0 0 0 0
$ret[$_] = 1 for ($first_pos..$last_pos);
$_ = 1 for @array[$first .. $last];