in reply to parentheses around a function call in a ternary choice

print (...) is always parsed as a function call print( ... ) (independently of what comes afterwards), so your code parses as
( print get1() ) ? ... : ...;

use warnings will make that line complain about useless constants in void context, which the rest of the line actually is.

BTW Perl 6 uses whitespaces to disambiguate, so print(...) and print (...) are really two different things (which seems to be what new Perl programmers expect).

Replies are listed 'Best First'.
Re^2: parentheses around a function call in a ternary choice
by didess (Sexton) on Jun 23, 2009 at 21:11 UTC
    Thank you! it's so obvious (afterwards ;-) !