in reply to Unexpected Output

Please use the $string = @arr ? 'False' : 'True'; idiom cdarke offered. $#arr is (so I say) a poor style choice to use anywhere (in general) and both confusing and potentially error prone here (as nvivek notes).

Replies are listed 'Best First'.
Re^2: Unexpected Output
by k_manimuthu (Monk) on Jul 29, 2010 at 07:26 UTC

    Dear All - Thanks a lot for your suggestion and solutions.
    Thanks to introduce some new things to me. Specially for ...

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