8
I have a question about the range operator in Perl. The code is here:
#! /usr/bin/perl
open FILE, "<test.txt";
while (<FILE>) {
print if (1 .. 5);
}
close FILE;
The contents in test.txt is something like:
1
2
3
4
5
The result of the code is all five lines of the file. There is no difference when I use print if (1 ... 5). I think it should output four lines.
Is there something I made a mistake in?