Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello everyone, A recent thread reminded me of a script I wrote years ago while learning about the flip-flop operator (aka the range operator in scalar context), and I thought I'd share it in case it helps someone else. The script, which I've included below the output, runs through a sequence of true/false values, tests whether the right-hand-side and/or left-hand-side of the operator is evaluated (marked by an asterisk in the table), gets the return value of the operator, and outputs all that in the following handy table. I hope it illustrates the difference between the .. (two-dot) and ... (three-dot) versions of the operator: two dots will immediately evaluate the RHS if the LHS is true, three dots will wait until the next evaluation.
Regards, In reply to Behavior of Flip-Flop Operators by haukex
|
|