$. 是文件接口1. 准备文件welcome.txt
D:\>type welcome.txt
aasfd
afaf
as
sfd adf
2. 运行如下:
D:\>perl -ne "print $.,':',$_" welcome.txt
1:aasfd
2:afaf
3:
4:as
5:sfd adf
D:\>perl -ne "print $.,':',$_" welcome.txt welcome.txt2
1:aasfd
2:afaf
3:
4:as
5:sfd adf
6:aasfd
7:afaf
8:
9:as
10:sfd adf