in reply to ?: (conditional operator)

You can't modify $x in the print statement and expect the result you are expecting.

This will work:

perl -e '$x="\nYo "; $x ? $x.="hello" : $x.="Bye";print $x;'