Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I was using the short c-style IF statment in my code and I understood it worked by EXPR ? TRUE :FALSE; however when I compiled this:
6 < 8 ? $ans = "true" : $ans = "false";$ans was false... can anyone explain what happened?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: if statement confusion
by toolic (Bishop) on Jun 11, 2012 at 14:15 UTC | |
Re: if statement confusion
by Anonymous Monk on Jun 11, 2012 at 14:13 UTC | |
Re: if statement confusion
by davido (Cardinal) on Jun 11, 2012 at 17:31 UTC | |
Re: if statement confusion
by Anonymous Monk on Jun 11, 2012 at 14:56 UTC | |
Re: if statement confusion
by eyepopslikeamosquito (Archbishop) on Jun 12, 2012 at 12:28 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom