in reply to Re^2: Ternary Operator with Subroutine
in thread Ternary Operator with Subroutine
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.
|
|---|