为什么Perl不会在工作的Windows目录中看到我的文件?

时间:2016-04-21 14:27:54

标签: perl

我正在使用当前版本的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.

1 个答案:

答案 0 :(得分:7)

在Windows命令行中,在需要引用的命令行参数周围使用双引号。

perl -ne "print if (rand() < .01)" train.csv