pmc2 has asked for the wisdom of the Perl Monks concerning the following question:
Could someone please explain to me why the following snippet prints "Yo helloBye" and not just "Yo hello"?
I thought the above example was equivalent to:perl -e '$x="\nYo "; print ($x ? $x.="hello" : $x.="Bye");'
which correctly prints "Yo hello". Any thoughts?perl -e '$x="\nYo "; if ($x) {print $x."hello";} else {print $x."Bye" +;}'
Back to
Seekers of Perl Wisdom