elevenfly has asked for the wisdom of the Perl Monks concerning the following question:

Hello! I found a code like this:

 perl -n -e 'print $_ if 1..2' test.txt

This code will only print the first and second in test.txt and I was told that if will compare $. with the line number I provide. But what is the reason for that?

Can anyone provide any help?