From: David Flanagan Date: 2007-09-11T05:19:44+09:00 Subject: integer range literals in conditionals with -e option Hi, Here's a question for experts whose memories go back to vrsion 1.6 or before... I know that you can use regexp literals in conditionals with the -e option. There is an implicit comparison to $_ in this case. I gather that this used to work everywhere (in 1.6?) but that in 1.8 it only works with -e. The Pickaxe asserts that range literals can also be used in conditionals with -e and that there is an implicit test against $. (current line number). This would allow awk-like scripts to print a set of line numbers: ruby -n -e 'print if 1..5'. There appears to be code to implement this in parse.y, but I can't make it work. (See the range_op method, which appears to insert a == comparison with $. Which is surprising, since it ought to insert a === comparison, I'd think. The code never seems to be triggered, though.) Anyone know what the history and current status of this is? Is the code in parse.y vestigal, or is a regresson that this feature stopped working in 1.8? David