in reply to Unexpected Output
then the output is as expected. However it is probably better written as:($#arr == -1 ) ? ($string = 'True' ): ($string = 'False');
$string = ($#arr == -1 ) ? 'True' : 'False';
The array in scalar context gives the number of elements (zero is false).$string = @arr ? 'False' : 'True';
|
|---|