The .. operator in scalar context is the flip-flop operator, not the range operator.Firstly, I never explicitly named the .. operator in my post; I merely linked to the Perl official documentation which describes the .. operator, titled Range Operators.
Secondly, the documentation appears to disagree with your assertion that .. in scalar context is not the range operator (emphasis is mine):
In scalar context, ".." returns a boolean value. The operator is bistable, like a flip-flop, and emulates the line-range (comma) operator of sed, awk, and various editors. Each ".." operator maintains its own boolean state. It is false as long as its left operand is false. Once the left operand is true, the range operator stays true until the right operand is true, AFTER which the range operator becomes false again. It doesn't become false till the next time the range operator is evaluated. It can test the right operand and become false on the same evaluation it became true (as in awk), but it still returns true once. If you don't want it to test the right operand till the next evaluation, as in sed, just use three dots ("...") instead of two. In all other regards, "..." behaves just like ".." does.You may refer to the operator however you wish, but it is correct to refer to it as the "range operator" in all contexts, including scalar context.
In reply to Re^3: querying a range of values
by toolic
in thread querying a range of values
by plendid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |