in reply to Unexpected Output

The problem is that the assignment operator has looser precedence than the ternary/conditional operator ? :.

Instead, use

$string = $#arr == -1 ? 'True' : 'False';

If you want to assign to two different variables, use an ordinary if construct instead of the ternary operator.

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