我需要在Perl中使用system()运行shell命令.例如,
system('ls')
系统调用将打印到STDOUT,但我想将输出捕获到变量中,以便我可以使用Perl代码进行将来的处理.
shell perl
perl ×1
shell ×1