On one of our Windows XP machines, Perl system commands such as dir /b
generate an error message such as: /b: no such file or directory
. In other words, the switch is being interpreted as a filename.
This occurs whether I use backticks
, open()
or system()
. I even tried passing in the switch as a separate arg to system(). Naturally, I have confirmed that the call works correctly on the DOS command line or batch script.
Has anybody else encountered this?
Unverified:
dir
is a command interpreter built-in command. Run the command interpreter with a/c
or/k
switch instead, followed by the command you want to execute.You probably have Cygwin installed and
dir.exe
is in your path which is not thecmd.exe
built-in but an alias tols
.