Hi, > Just to muddy the waters a little more (and hopefully answer a > question I've had for a while): how does the "flip-flop" operator > function here: > > while (<>) { > next if 1..9; > # the rest of the code > }
Since I (used to) try to turn stuff into Rocket Science, I at first was trying to get the wrong idea of how range/flip_flop works. (it seems that it's a rather simple matter though I found it not an easy one to grasp at first) I think I have it correct now. If not, I'm sure someone will correct me. (in the above code) If it's true (scalar context) that (we currently have or are in/within the) "range of from 1 through 9" then what we do is we "next" (next jumps it to the next iteration) Given 12 lines, it will ring true for the first 9. Lines 10, 11, and 12 (returns false) will get the "# the rest of the code". the first 9 lines will be skipped because of being "next"ed (they will not get the "# the rest of the code"). but it will test/check all 12 lines The flip flop merely has the capability to "toggle" (revert, flip flop) it's true/false My conception of it is that the so called "range" happens to be or else could be viewed as a by product which is produced of/from/due_to that checking/test and the flip flop. -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>