我正在使用当前版本的Strawberry Perl和Windows Server 2008。
出于某种原因,Perl似乎没有在当前工作目录中找到文件:
F:\temp\hackr\e>ls
test.csv train.csv
F:\temp\hackr\e>perl -ne 'print if (rand() < .01)' train.csv
The system cannot find the file specified.
答案 0 :(得分:7)
在Windows命令行中,在需要引用的命令行参数周围使用双引号。
perl -ne "print if (rand() < .01)" train.csv