in reply to print question
It stems from the fact that print, if immediately followed by a lparen (with \s* in between), assumes that the lparen and its matching rparent enclose print's entire parameter list. You can clear up print's "confusion" by adding another set of parens to enclose the parameter list:
print( ("a", "b")[1] );
|
|---|