perl -e '$x="\nYo "; print ($x ? $x.="hello" : $x.="Bye");' => 'Yo helloBye' perl -e '$x="\nYo "; print ($x ?($x.="hello") : ($x.="Bye"));' => 'Yo hello' perl -e '$x="\nYo "; print ($x ? $x."hello" : $x."Bye");' => 'Yo hello' perl -e '$x="\nYo "; print ($x ? $x."hello" : $x.="Bye");' => Can't modify concatenation (.) or string in concatenation (.) or string at -e line 1, near ""Bye")" Execution of -e aborted due to compilation errors. perl -e '$x="\nYo "; print ($x ? $x."hello" : ($x.="Bye"));' => 'Yo hello'