Return Perl-output to PHP

后端 未结 2 1495
再見小時候
再見小時候 2020-12-12 06:02

I want to return the output of a perl script to a webpage. However it only returns the last line.

Perl script:

my $directory = $ARGV[0];
opendir(DI         


        
2条回答
  •  隐瞒了意图╮
    2020-12-12 06:28

    From php docs,

    Return Values

    The last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.

    To get the output of the executed command, be sure to set and use the output parameter

提交回复
热议问题