|more useful options|
Re^3: Is it a list or a flip-flop?by Transient (Hermit)
|on Aug 18, 2005 at 19:21 UTC||Need Help??|
The value returned is either the empty string for false, or a sequence number (beginning with 1) for true. The sequence number is reset for each range encountered. The final sequence number in a range has the string "E0" appended to it, which doesn't affect its numeric value, but gives you something to search for if you want to exclude the endpoint. You can exclude the beginning point by waiting for the sequence number to be greater than 1.
The range operator has always stumped me a bit, so I can't say much more than what it says above
Update: I suppose it is working like this (in the case of setting $. to 1) - please correct me if I am wrong:
Since 1 is a constant, and so is $., it is evaluated as TRUE.
Since the LHS is true, the RHS is evaluated immediately.
Since the RHS is NOT a constant, it is not compared to $., but is returned as true because it is not false (i.e. 9 is not 0, "" or undef).
The range operation is completed.
Because it is a single iteration only, the sequence number is 1, and is appended with "E0"