in reply to Splitting string (regex) while keeping the separator?

If you want to have the delimiter as a separate list item, then use capturing parenthesis around it.

If you want to have it attached to the previous item, you need to make it a zero-width look-behind:

split(/(?<=[KR])(?!P)/, $a);

Also you have a few errors in your script that prevent the snippet you posted from producing the output you show. (Mis-named variables, missing semicolon).

Perl 6 - links to (nearly) everything that is Perl 6.