Hack-R Hack-R - 2 years ago 57
Perl Question

Why doesn't Perl see my file in the working Windows directory?

I'm using the current release of Strawberry Perl and Windows Server 2008.

For some reason Perl doesn't seem to find files in the current working directory:

test.csv train.csv

F:\temp\hackr\e>perl -ne 'print if (rand() < .01)' train.csv
The system cannot find the file specified.

mob mob
Answer Source

On the Windows command line, use double quotes around command line arguments that need quoting.

perl -ne "print if (rand() < .01)" train.csv
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download