You're hitting an edge case. The optimization had a different situation in mind:
if( 1 && foo() ) { . . . } elsif( 0 || bar() ) { . . . }
This optimization is hardly unique to Perl. I believe both C and Java compilers will optimize away constants in exactly the same way.
----
: () { :|:& };:
Note: All code is untested, unless otherwise stated
In reply to Re: Re: Re: Short Circuit Operator and Hash Assignment
by hardburn
in thread Short Circuit Operator and Hash Assignment
by periapt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |