in reply to Unexpected Output

This is a precedence problem with your ternary statement. If you parenthesise:
($#arr == -1 ) ? ($string = 'True' ): ($string = 'False');
then the output is as expected. However it is probably better written as:
$string = ($#arr == -1 ) ? 'True' : 'False';

By the way, $#arr is not the length of the array, it is the highest index number. So your ternary could be written like this:
$string = @arr ? 'False' : 'True';
The array in scalar context gives the number of elements (zero is false).