Is there any possibility, that my $test may fail?
Actually, it will always "fail". That is, an uninitialised variable is always undef, and therefore false.
It also doesn't make much sense to do print 'a'; print 'b'; instead of print 'a', 'b'; or print 'ab';.
I think it is fair to assume that the code supplied it greatly simplified example and that ( my $test ) is just a placeholder for 'some boolean condition' rather than an actual variable declaration.
In reply to Re^3: Ternary Operator with Subroutine
by BrowserUk
in thread Ternary Operator with Subroutine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |