in reply to Re^17: printing unitialized value of the 'do BLOCK' (EXPRESSION vs TERM vs STATEMENT)
in thread printing unitialized value of the 'do BLOCK'
So Perl's if is an expression, especially when executed in a scalar or list context due to a surrounding do.
No.
Again, the condition of an if statement is defined to be an expression, so
if ( ... ) { ... }
isn't an expression because
if ( if ( ... ) { ... } ) { }
isn't valid.
Furthermore, if any statement is an expression because any statement can be found at the end of the block of a do BLOCK, then the paragraph that's been quoted saying that the returned value is only defined for expressions wouldn't make sense.
Your usage of the terms clearly differs from the documentation's.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^19: printing unitialized value of the 'do BLOCK' (EXPRESSION vs TERM vs STATEMENT)
by LanX (Saint) on Dec 28, 2019 at 17:20 UTC | |
by ikegami (Patriarch) on Dec 28, 2019 at 17:33 UTC | |
by LanX (Saint) on Dec 28, 2019 at 17:53 UTC | |
by ikegami (Patriarch) on Dec 28, 2019 at 23:25 UTC | |
by LanX (Saint) on Jan 02, 2020 at 13:30 UTC |