<?xml version="1.0" encoding="windows-1252"?>
<node id="377663" title="Re: The Scalar Range Operator" created="2004-07-27 01:41:23" updated="2005-06-26 21:01:36">
<type id="11">
note</type>
<author id="211692">
pg</author>
<data>
<field name="doctext">
&lt;blockquote&gt;"The condition evaluates false until $left evaluates true. Then the $left condition is ignored, and the condition continues to evaluate true until $right evaluates true, at which point the condition evaluates false, and it goes back to check $left."&lt;/blockquote&gt;
&lt;p&gt;Not very precise, and a bit misleading. In the case of "if (2..4)", $left is 2, and $right is 4, both of them always evalutes to true. I know that later you explained that, they were compared to $., and that was right. I suggest you reword this part to make it correct, and agree with other parts of your post.&lt;/p&gt;
&lt;p&gt;I think it would be useful to give this example, to explain an interesting situation, which people might run into:&lt;/p&gt;
&lt;code&gt;
use strict;
use warnings;

open(FILE, "&lt;", "test.dat");
while (&lt;FILE&gt;)
{
    print if 2 .. 4;
}
print "=====\n";
open(FILE, "&lt;", "test.dat");
while (&lt;FILE&gt;)
{
    print if 2 .. 4;
}
====input====
one
two
three
four
five
====output====
two
three
four
=====
&lt;/code&gt;
&lt;p&gt;This reminds people the fact that $. is not reset when a file is reopened when no explicit close() called in between.&lt;/p&gt;
</field>
<field name="root_node">
377450</field>
<field name="parent_node">
377450</field>
</data>
</node>
