How do I expand variables in Perl readpipe handlers?

▼魔方 西西 提交于 2019-12-04 08:51:09

That appears to be a bug in Perl. Use perlbug to report it.

You probably want to use IPC::Run instead.

use IPC::Run 'run';

run [ "ls", $dir ], ">", \my $stdout or die "Cannot run - $!";

Or if you didn't want to capture the output, system() may be better

system( "ls", $dir ) == 0 or die "Cannot system - $!";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!