In article <2F46EE5C-543A-11D8-99FF-000A95CD7A8E / talbott.ws>,
Nathaniel Talbott  <nathaniel / talbott.ws> wrote:
>On Jan 31, 2004, at 16:51, Dan Doel wrote:
>
>> Phil Tomson wrote:
>>
>>> identical as in there is no difference in behavior between them?
>>>
>> Yes, that's what I meant.
>
>Actually there is a difference... see:
>
>    
>http://sean.chittenden.org/programming/ruby/programming_ruby/ 
>language.html
>
>Search for "Ranges in Boolean Expressions" (this was missing from the  
>online pickaxe at rubycentral.com - not sure why).
>
>If someone can explain the difference in a meaningful way, I'd be  
>grateful... I have enough trouble with the flip-flop as it is, and now  
>this!
>
>
>Nathaniel


Thanks for the reference.  I thought I'd seen that state diagram 
somewhere.  It wasn't in the online version I was checking. 

The best way to illustrate the difference is to use an example.  Given the 
file 'file':

nine
10 BEGIN skdadk END
eleven
12
thirteen
14 END PATTERN
fifteen
---------END OF FILE-------------

And given the script:

File.foreach("filename"){|l|
  if l=~/BEGIN/ .. l=~/END/
    puts l
  end
}

The output will be:

10 BEGIN skdadk END

changing the .. to ... , the output will be:

10 BEGIN skdadk END
eleven
12
thirteen
14 END PATTERN


I think this is different behavior from Perl's version of the ... 
flip/flop, but I'ld have to check.

Phil