Hello! I found a code like this:
perl -n -e 'print $_ if 1..2' test.txtThis 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?
Thanks!,
In reply to How does $. work in one liner? by elevenfly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |