In article <200401311343.i0VDh2Z00793 / moulon.inra.fr>, ts <decoux / moulon.inra.fr> wrote: >>>>>> "P" == Phil Tomson <ptkwt / aracnet.com> writes: > >P> in_header = $.==1 .. l=~/^$/ > > this is not the flip flop operator, but the range operator : this is why > it give an error > >P> in_header = $.==1 .. l=~/^$/ ? true : false > > this is the flip flop operator Yes, I figured that it was being interpreted that way, but my question is why? this part: $.==1 .. l=~/^$/ is the same in both statements. Why does it get interpreted as a range in one case, and a flip flop in the other? I could see that if I did: ($.==1 .. l=~/^$/) that the interpreter could get the idea that it's a range, but it would be a range like this: (false..true) or (true..false) because $.==1 has to evaluate to either true or false. If I try either one of these in irb I get: (true..false) ArgumentError: bad value for range (false..true) ArgumentError: bad value for range so it appears that you can't have a range of TrueClass, FalseClass therefore why doesn't the interpreter think it's a flip/flop operator? Phil