我在win7上使用AS perl.
print `cd \\\\ `; # does nothing, says nothing
Run Code Online (Sandbox Code Playgroud)
与qx()相同
print `dir \\\\ `; # correctly prints the root directory
Run Code Online (Sandbox Code Playgroud)
其他命令似乎也运行正常.
cd从批处理文件的命令行正常工作.
有没有人见过这个?有解决方法吗?
你可能正在寻找chdir.在反引号中使用shell命令不会产生持久影响.当您运行反引号命令时,您生成一个新的shell,执行该命令,并将标准输出返回给Perl.然后shell退出,对它的任何和所有更改都将丢失.