in reply to subroutine return ternary output

Not playing with the ternary x?y:z but here is another approach
return not (system "$KSH_SCRIPT")

Cheers,
R.