http://www.perlmonks.org?node_id=993379


in reply to grep flip flop (range operator)

My understanding is that with Range Operators, if you have 1 .. /Q/, the 1 is short for $. == 1, so it will flip on and start printing at the first line of input from a file. The last example you are using is the only one that is reading from a file and, therefore, is the only one that flips on and prints.

Edit: for those that are unfamiliar with $., is is a special variable that equals the "current line number for the last filehandle accessed" (see perlvar).