in reply to problem in my sub partition

You are accessing one value beyond the end of array @a. That returns undef, and thus you get the warnings.

Since addition treats undef as 0, and that is what you, just switch off the warning:

for($i=1;$i<=$k;$i++){ $j = $i - 1; no warnings 'uninitialized'; $b[$i] = $a[$i] + $a[$j]; }
Perl 6 - links to (nearly) everything that is Perl 6.